Documentation
¶
Overview ¶
Package contextservice manages durable review targets independently of transports.
Index ¶
- type Context
- type Page
- type Service
- func (service *Service) Close() error
- func (service *Service) Count(ctx context.Context) (int, error)
- func (service *Service) Delete(ctx context.Context, id string) error
- func (service *Service) Get(ctx context.Context, id string) (Context, error)
- func (service *Service) Ingest(ctx context.Context, input ingestion.Request) (Submission, error)
- func (service *Service) List(ctx context.Context, limit int, cursor string) (Page, error)
- func (service *Service) ListFiltered(ctx context.Context, limit int, cursor string, filter ingestion.Filter) (Page, error)
- func (service *Service) Resolve(ctx context.Context, id string) (session.Session, error)
- func (service *Service) Subscribe() (<-chan string, func())
- func (service *Service) UserID() string
- type Store
- type Submission
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
Stale bool `json:"stale"`
Sessions []reviewdata.SessionAssociation `json:"sessions,omitempty"`
Observation *ingestion.Metadata `json:"observation,omitempty"`
ID string `json:"id"`
Kind string `json:"kind"`
Source string `json:"source"`
Name string `json:"name"`
Root *string `json:"root"`
LocationID *string `json:"locationId"`
RepositoryID *string `json:"repositoryId"`
CreatedAt int64 `json:"createdAt"`
LastSubmittedAt int64 `json:"lastSubmittedAt"`
LastChangedAt int64 `json:"lastChangedAt"`
ChangedFileCount *int `json:"changedFileCount"`
ExpiresAt *int64 `json:"expiresAt"`
SubmittedFrom *string `json:"submittedFrom"`
Capabilities session.Capabilities `json:"capabilities"`
Availability string `json:"availability"`
Branch *string `json:"branch"`
WorktreeName *string `json:"worktreeName"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewWithContext ¶
func (*Service) ListFiltered ¶
type Store ¶
type Store interface {
IngestContext(context.Context, string, ingestion.Request) (reviewdata.Binding, error)
ObservationSnapshot(string, string, review.DiffMode) (review.RepositoryDiff, error)
ObservationPatch(string, string, review.DiffMode, string) (review.FilePatch, error)
ObservationContexts(string, int, int64, string, ingestion.Filter) ([]reviewdata.ContextInfo, error)
Context(string, string, time.Time) (reviewdata.ContextInfo, error)
ContextBinding(string, string, time.Time) (reviewdata.Binding, error)
Contexts(string, int, int64, string, time.Time) ([]reviewdata.ContextInfo, error)
ContextCount(string, time.Time) (int, error)
DeleteContext(string, string) error
}
Store preserves atomic ingestion; callers cannot partially publish an observation.
type Submission ¶
type Submission struct {
Context Context `json:"context"`
Snapshot review.RepositoryDiff `json:"snapshot"`
}
Click to show internal directories.
Click to hide internal directories.