Пример #1
0
func (c *Client) append(name string, path string) error {
	p, err := vfs.NewPath(path)
	if err != nil {
		return err
	}

	return c.player.Append(name, p)
}
Пример #2
0
func (c *Client) play(path string) error {
	p, err := vfs.NewPath(path)
	if err != nil {
		return err
	}

	return c.player.Play(p)
}
Пример #3
0
func (c *Client) ls(path string) ([]string, error) {
	p, err := vfs.NewPath(path)
	if err != nil {
		return nil, err
	}
	if !p.IsDir() {
		return nil, errors.New("not a directory")
	}
	entries, err := p.List()
	if err != nil {
		return nil, err
	}

	lines := make([]string, 0, len(entries))
	for _, e := range entries {
		lines = append(lines, serialize.Entry(e))
	}

	return lines, nil
}