Documentation
¶
Index ¶
- Constants
- Variables
- func RequestRefreshTx(ctx context.Context, tx pgx.Tx, org, repo string) error
- func RequireFreshTx(ctx context.Context, tx pgx.Tx, org, repo string) error
- type ChangePage
- type Decoder
- type ImportInput
- type IssuedWebhook
- type Job
- type Reader
- type Repository
- type RepositoryFilter
- type Service
- func (s *Service) AdoptWebhookTx(ctx context.Context, tx pgx.Tx, a domain.Actor, ...) (string, error)
- func (s *Service) Cancel(ctx context.Context, session auth.Session, org, id string, expected int64, ...) (Job, error)
- func (s *Service) Candidates(ctx context.Context, session auth.Session, org, id string, limit int, ...) (domain.Page[forge.Repository], error)
- func (s *Service) Changes(ctx context.Context, session auth.Session, org, repo string, limit int, ...) (ChangePage, error)
- func (s *Service) Claim(ctx context.Context, org, worker string) (*Job, error)
- func (s *Service) ConfigureWebhook(ctx context.Context, session auth.Session, org, connectionID string, ...) (IssuedWebhook, error)
- func (s *Service) HandleHostedWebhook(ctx context.Context, org, connectionID, endpointID string, appID int64, ...) error
- func (s *Service) HandleWebhook(ctx context.Context, org, id string, headers http.Header, body []byte) error
- func (s *Service) Job(ctx context.Context, session auth.Session, org, id string) (Job, error)
- func (s *Service) Jobs(ctx context.Context, session auth.Session, org string, limit int, ...) (domain.Page[Job], error)
- func (s *Service) Maintain(ctx context.Context, org string) error
- func (s *Service) Repositories(ctx context.Context, session auth.Session, org string, limit int, ...) (domain.Page[Repository], error)
- func (s *Service) RepositoriesFiltered(ctx context.Context, session auth.Session, org string, limit int, ...) (domain.Page[Repository], error)
- func (s *Service) Repository(ctx context.Context, session auth.Session, org, id string) (Repository, error)
- func (s *Service) RevokeWebhook(ctx context.Context, session auth.Session, org, connectionID string, ...) error
- func (s *Service) Run(ctx context.Context, worker string) error
- func (s *Service) RunOnce(ctx context.Context, worker string) (bool, error)
- func (s *Service) StartImport(ctx context.Context, session auth.Session, org, syncID string, in ImportInput, ...) (Job, error)
- func (s *Service) StartSync(ctx context.Context, session auth.Session, org string, in SyncInput, ...) (Job, error)
- func (s *Service) Step(ctx context.Context, lease Job) error
- func (s *Service) Webhook(ctx context.Context, session auth.Session, org, connectionID string) (Webhook, error)
- type SyncInput
- type Webhook
Constants ¶
View Source
const MaxWebhookBytes = 1 << 20
Variables ¶
View Source
var ErrBusy = errors.New("inventory queue is full")
View Source
var ErrIncomplete = errors.New("provider inventory is incomplete")
View Source
var ErrStale = errors.New("inventory observation or lease is stale")
View Source
var ErrWebhookUnconfigured = errors.New("webhook is not configured")
Functions ¶
func RequestRefreshTx ¶
Types ¶
type ChangePage ¶
type ImportInput ¶
type IssuedWebhook ¶
func (IssuedWebhook) GoString ¶
func (w IssuedWebhook) GoString() string
func (IssuedWebhook) LogValue ¶
func (w IssuedWebhook) LogValue() slog.Value
func (IssuedWebhook) String ¶
func (w IssuedWebhook) String() string
type Job ¶
type Job struct {
ID string `json:"id"`
OrgID string `json:"org_id"`
ConnectionID string `json:"connection_id"`
ConnectionVersion int64 `json:"connection_version"`
Namespace string `json:"namespace"`
Kind string `json:"kind"`
RepositoryID string `json:"repository_id,omitempty"`
ParentID string `json:"parent_id,omitempty"`
RequestedBy string `json:"-"`
Input []byte `json:"-"`
State string `json:"state"`
Reason string `json:"reason,omitempty"`
Cursor string `json:"-"`
Phase string `json:"-"`
Pages int `json:"pages"`
Processed int `json:"processed"`
Failures int `json:"failures"`
Fence int64 `json:"-"`
LeaseOwner string `json:"-"`
LeaseUntil *time.Time `json:"-"`
AvailableAt time.Time `json:"available_at"`
Version int64 `json:"version"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
type Reader ¶
type Reader interface {
Read(context.Context, string, string, privateconnector.Operation, func(context.Context, pgx.Tx, connections.Connection) error) (privateconnector.Result, error)
}
type Repository ¶
type RepositoryFilter ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AdoptWebhookTx ¶
func (*Service) Candidates ¶
func (*Service) ConfigureWebhook ¶
func (*Service) HandleHostedWebhook ¶
func (*Service) HandleWebhook ¶
func (*Service) Repositories ¶
func (*Service) RepositoriesFiltered ¶
func (*Service) Repository ¶
func (*Service) RevokeWebhook ¶
func (*Service) StartImport ¶
Click to show internal directories.
Click to hide internal directories.