Documentation
¶
Index ¶
- type Attachment
- type AttachmentDraft
- type AttachmentUpdate
- type Repository
- type Root
- type RootDraft
- type RootUpdate
- type Service
- func (s *Service) Attach(ctx context.Context, rootID artifactstore.RootID, expectedRootRevision uint64, ...) (Root, Attachment, error)
- func (s *Service) Create(ctx context.Context, draft RootDraft, attachmentDrafts []AttachmentDraft) (Root, []Attachment, error)
- func (s *Service) Delete(ctx context.Context, id artifactstore.RootID, expectedRevision uint64) (Root, error)
- func (s *Service) Detach(ctx context.Context, rootID artifactstore.RootID, ...) (Root, error)
- func (s *Service) Get(ctx context.Context, id artifactstore.RootID) (Root, error)
- func (s *Service) GetAttachment(ctx context.Context, rootID artifactstore.RootID, ...) (Attachment, error)
- func (s *Service) GetIncludingDeleted(ctx context.Context, id artifactstore.RootID) (Root, error)
- func (s *Service) List(ctx context.Context, includeDeleted bool) ([]Root, error)
- func (s *Service) ListAttachments(ctx context.Context, rootID artifactstore.RootID) ([]Attachment, error)
- func (s *Service) Update(ctx context.Context, id artifactstore.RootID, update RootUpdate) (Root, error)
- func (s *Service) UpdateAttachment(ctx context.Context, rootID artifactstore.RootID, ...) (Root, Attachment, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct {
RootID artifactstore.RootID `json:"rootID"`
SourceID artifactstore.SourceID `json:"sourceID"`
Role artifactstore.AttachmentRole `json:"role"`
Priority int `json:"priority"`
Enabled bool `json:"enabled"`
Data json.RawMessage `json:"data"`
Revision uint64 `json:"revision"`
CreatedAt time.Time `json:"createdAt"`
ModifiedAt time.Time `json:"modifiedAt"`
}
func (Attachment) Validate ¶
func (a Attachment) Validate() error
type AttachmentDraft ¶
type AttachmentDraft struct {
SourceID artifactstore.SourceID
Role artifactstore.AttachmentRole
Priority int
Enabled bool
Data json.RawMessage
}
type AttachmentUpdate ¶
type AttachmentUpdate struct {
ExpectedRootRevision uint64
ExpectedAttachmentRevision uint64
Role artifactstore.AttachmentRole
Priority int
Enabled bool
Data json.RawMessage
}
type Repository ¶
type Repository interface {
Create(
ctx context.Context,
root Root,
attachments []Attachment,
) error
Get(
ctx context.Context,
id artifactstore.RootID,
includeDeleted bool,
) (Root, error)
List(
ctx context.Context,
includeDeleted bool,
) ([]Root, error)
Update(
ctx context.Context,
value Root,
expectedRevision uint64,
) error
Attach(
ctx context.Context,
attachment Attachment,
expectedRootRevision uint64,
) (Root, error)
GetAttachment(
ctx context.Context,
rootID artifactstore.RootID,
sourceID artifactstore.SourceID,
) (Attachment, error)
ListAttachments(
ctx context.Context,
rootID artifactstore.RootID,
) ([]Attachment, error)
UpdateAttachment(
ctx context.Context,
value Attachment,
expectedRootRevision uint64,
expectedAttachmentRevision uint64,
) (Root, error)
Detach(
ctx context.Context,
rootID artifactstore.RootID,
sourceID artifactstore.SourceID,
expectedRootRevision uint64,
expectedAttachmentRevision uint64,
modifiedAt time.Time,
) (Root, error)
}
type Root ¶
type Root struct {
ID artifactstore.RootID `json:"id"`
Kind artifactstore.RootKind `json:"kind"`
DisplayName string `json:"displayName"`
Description string `json:"description,omitempty"`
Enabled bool `json:"enabled"`
Data json.RawMessage `json:"data"`
Revision uint64 `json:"revision"`
CreatedAt time.Time `json:"createdAt"`
ModifiedAt time.Time `json:"modifiedAt"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
}
type RootDraft ¶
type RootDraft struct {
Kind artifactstore.RootKind
DisplayName string
Description string
Enabled bool
Data json.RawMessage
}
type RootUpdate ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( repository Repository, ids artifactstore.IDGenerator, clock artifactstore.Clock, ) (*Service, error)
func (*Service) Attach ¶
func (s *Service) Attach( ctx context.Context, rootID artifactstore.RootID, expectedRootRevision uint64, draft AttachmentDraft, ) (Root, Attachment, error)
func (*Service) Create ¶
func (s *Service) Create( ctx context.Context, draft RootDraft, attachmentDrafts []AttachmentDraft, ) (Root, []Attachment, error)
func (*Service) GetAttachment ¶
func (s *Service) GetAttachment( ctx context.Context, rootID artifactstore.RootID, sourceID artifactstore.SourceID, ) (Attachment, error)
func (*Service) GetIncludingDeleted ¶
func (*Service) ListAttachments ¶
func (s *Service) ListAttachments( ctx context.Context, rootID artifactstore.RootID, ) ([]Attachment, error)
func (*Service) Update ¶
func (s *Service) Update( ctx context.Context, id artifactstore.RootID, update RootUpdate, ) (Root, error)
func (*Service) UpdateAttachment ¶
func (s *Service) UpdateAttachment( ctx context.Context, rootID artifactstore.RootID, sourceID artifactstore.SourceID, update AttachmentUpdate, ) (Root, Attachment, error)
Click to show internal directories.
Click to hide internal directories.