Documentation
¶
Overview ¶
Package playbooks provides management of playbook directories and their files. Playbooks are reusable knowledge containers that users create and manage.
Index ¶
- type FileItem
- type Playbook
- type Service
- func (s *Service) AppendFile(playbookName, path, content, summary string) error
- func (s *Service) Create(name string) error
- func (s *Service) Delete(name string) error
- func (s *Service) DeleteFile(playbookName, path string) error
- func (s *Service) EditFile(playbookName, path, oldString, newString string, replaceAll bool) error
- func (s *Service) Exists(name string) bool
- func (s *Service) GetFile(playbookName, path string, offset, maxBytes int64) (*FileItem, error)
- func (s *Service) List() ([]Playbook, error)
- func (s *Service) ListFiles(playbookName, prefix string) ([]FileItem, error)
- func (s *Service) PutFile(playbookName, path, content, summary string) (bool, error)
- func (s *Service) Rename(name, newName string) error
- func (s *Service) RenameFile(playbookName, fromPath, toPath string) error
- func (s *Service) Search(playbookName, query string, limit, offset int) ([]FileItem, int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileItem ¶
type FileItem struct {
Playbook string `json:"playbook"`
Path string `json:"path"`
SizeBytes int64 `json:"size_bytes"`
ModifiedAt time.Time `json:"modified_at"`
Summary string `json:"summary,omitempty"`
Content string `json:"content,omitempty"`
// Byte range fields (only set when offset/max_bytes used)
Offset int64 `json:"offset,omitempty"`
TotalBytes int64 `json:"total_bytes,omitempty"`
}
FileItem represents a file within a playbook.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides playbook operations.
func NewService ¶
NewService creates a new playbooks service.
func (*Service) AppendFile ¶
AppendFile appends content to a file in a playbook
func (*Service) DeleteFile ¶
DeleteFile deletes a file from a playbook.
func (*Service) GetFile ¶
GetFile retrieves a file from a playbook with optional byte range. If offset is 0 and maxBytes is 0, returns the entire file. If maxBytes > 0, returns at most maxBytes starting from offset.
func (*Service) RenameFile ¶
RenameFile renames or moves a file within a playbook.
Click to show internal directories.
Click to hide internal directories.