Documentation
¶
Overview ¶
Package channels manages authoring homes and their public identity. Channels are not metadata: their AuthKit groups govern their original content items.
Index ¶
- type Card
- type Channel
- type Import
- type Input
- type ListOptions
- type Mine
- type MyPage
- type Options
- type Page
- type Repost
- type Store
- func (s *Store) As(a auth.Authenticator, actor access.Actor) *Store
- func (s *Store) Cards(ctx context.Context, ids []string, language string) ([]Card, error)
- func (s *Store) Create(ctx context.Context, in Input) (Channel, error)
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) Finish(ctx context.Context, ids []string) error
- func (s *Store) Get(ctx context.Context, id, language string) (Channel, error)
- func (s *Store) Handler(a auth.Authenticator) (http.Handler, error)
- func (s *Store) ImportDeletesTx(ctx context.Context, tx pgx.Tx, ids []string) error
- func (s *Store) ImportTx(ctx context.Context, tx pgx.Tx, in []Import, provision bool) error
- func (s *Store) List(ctx context.Context, in ListOptions) (Page, error)
- func (s *Store) ManagementGet(ctx context.Context, id, language string) (Channel, error)
- func (s *Store) ManagementList(ctx context.Context, in ListOptions) (Page, error)
- func (s *Store) Metadata(ctx context.Context, id, language string) ([]entities.EntityCard, error)
- func (s *Store) Mine(ctx context.Context, in ListOptions) (MyPage, error)
- func (s *Store) Raw(ctx context.Context, id string) (entities.Entity, error)
- func (s *Store) RawMany(ctx context.Context, ids []string) ([]entities.Entity, error)
- func (s *Store) SetMetadata(ctx context.Context, id string, ids []string) error
- func (s *Store) Update(ctx context.Context, id string, in Update) (Channel, error)
- type Update
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct {
ID string `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
NameLanguage string `json:"name_language,omitempty"`
Code string `json:"code,omitempty"`
Path string `json:"path,omitempty"`
Cover *entities.Cover `json:"cover,omitempty"`
Avatar *entities.Avatar `json:"avatar,omitempty"`
Count int `json:"count"`
Access *entities.EntityAccess `json:"access,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
Card is a channel's public identity and optional paid membership standing.
type Channel ¶
type Channel struct {
Card
State entities.State `json:"state"`
OwnerUserID string `json:"owner_user_id,omitempty"`
AuthScope string `json:"auth_scope,omitempty"`
Revision int64 `json:"revision"`
UpdatedAt time.Time `json:"updated_at"`
Names []entities.Name `json:"names"`
Text []entities.Text `json:"text"`
Counts []entities.Count `json:"counts"`
Entities []entities.EntityCard `json:"entities"`
}
Channel includes editable identity and metadata. Metadata grants no authority.
type Import ¶
type Import struct {
ID string
Slug string
State entities.State
Cover *entities.Cover
Avatar *entities.Avatar
OwnerUserID string
AuthScope string
Names []entities.Name
Text []entities.Text
Code string
CreatedAt *time.Time
UpdatedAt *time.Time
}
Import is a channel's explicit imported identity. Source media, public codes and authorization group IDs remain stable. Omitted names/text preserve them.
type ListOptions ¶
type Mine ¶
type Mine struct {
Card
Owner bool `json:"owner"`
Editor bool `json:"editor"`
CanPost bool `json:"can_post"`
CanEditOwn bool `json:"can_edit_own"`
Writer bool `json:"writer"`
Moderator bool `json:"moderator"`
Member bool `json:"member"`
}
Mine includes current authoring permissions, not the creator's past authority.
type Repost ¶
type Repost struct {
ChannelID string `json:"channel_id"`
ActorID string `json:"actor_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
CanRemove bool `json:"can_remove"`
}
Repost identifies the destination reference without copying original content.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a catalog's channels. Existing persisted identity, media and scope bytes are retained; callers only see this typed channel interface.
func New ¶
New opens a standalone channel store, for example for a staff role CLI. It does not migrate, seed channels or construct another authentication server.
func (*Store) Delete ¶
Delete withdraws the channel and completes its group/content lifecycle synchronously. Retained media remains owned by the existing purge sweep.
func (*Store) Finish ¶
Finish completes synchronous cross-store lifecycle operations after a caller-owned import transaction commits. Retrying the same IDs is safe.
func (*Store) ImportDeletesTx ¶
func (*Store) ImportTx ¶
ImportTx stores identities in the import transaction. Call Finish after commit to apply the corresponding AuthKit operation synchronously.
func (*Store) ManagementGet ¶
func (*Store) ManagementList ¶
func (*Store) Raw ¶
Raw returns channel identity for the engine's permission/media adapters. It is not exposed by the HTTP contract.
func (*Store) SetMetadata ¶
type Update ¶
type Update struct {
ID string `json:"-"`
OwnerUserID *string `json:"owner_user_id,omitempty"`
Slug *string `json:"slug,omitempty"`
Names []entities.Name `json:"names,omitempty"`
Text []entities.Text `json:"text,omitempty"`
Cover *entities.Cover `json:"cover,omitempty"`
Avatar *entities.Avatar `json:"avatar,omitempty"`
State *entities.State `json:"state,omitempty"`
}