Documentation
¶
Index ¶
- Constants
- type Item
- type Repository
- type Service
- func (s *Service) CreateItem(ctx context.Context, item Item) (*Item, error)
- func (s *Service) DeleteItems(ctx context.Context, names []string) error
- func (s *Service) GetItem(ctx context.Context, name string) (*Item, error)
- func (s *Service) ListItems(ctx context.Context, fieldmask []string) ([]*Item, error)
- func (s *Service) UpsertItems(ctx context.Context, items []Item) ([]*Item, error)
Constants ¶
View Source
const ItemResource = "item"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
Name string
DisplayName string
Content string
Hash string
CreateTime time.Time
UpdateTime time.Time
DeleteTime *time.Time
Properties map[string]any
Metadata map[string]any
}
Item is the core data structure for the content management system. An item represent a single piece of content. It is the structured version of a markdown file.
type Repository ¶
type Repository interface {
CreateItem(ctx context.Context, tx *sql.Tx, item Item) (*Item, error)
GetItem(ctx context.Context, tx *sql.Tx, name string) (*Item, error)
UpdateItem(ctx context.Context, tx *sql.Tx, item Item) (*Item, error)
ListItems(ctx context.Context, tx *sql.Tx, fieldmasks []string) ([]*Item, error)
UpsertItem(ctx context.Context, tx *sql.Tx, item Item) (*Item, error)
DeleteItems(ctx context.Context, tx *sql.Tx, names []string) error
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is a service for managing items.
func NewService ¶
func NewService(db *sql.DB, repo Repository) *Service
func (*Service) CreateItem ¶
CreateItem creates a new item.
func (*Service) DeleteItems ¶
DeleteItems deletes a list of items by the unique names.
Click to show internal directories.
Click to hide internal directories.