Documentation
¶
Overview ¶
Package callback provides functionality for sending operation status callbacks to GitLab. It implements mechanisms for reporting success or failure of operations (particularly indexing) back to GitLab via internal API calls. The package handles constructing appropriate payloads, including repository statistics when needed, and manages the HTTP communication with configurable timeouts and authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdditionalPayload ¶
type AdditionalPayload struct {
RepoStats *disk_stats.RepoStats `json:"repo_stats,omitempty"`
}
AdditionalPayload might get new fields in the future when there will be new callback actions. Right now we add only RepoStats for the index action
type CallbackAPI ¶ added in v0.15.0
func NewCallbackAPI ¶ added in v0.15.0
func (CallbackAPI) SendFailure ¶ added in v0.15.0
func (c CallbackAPI) SendFailure(ctx context.Context, callbackParams CallbackParams, indexDir string, repoID uint64, failureReason error)
func (CallbackAPI) SendSuccess ¶ added in v0.15.0
func (c CallbackAPI) SendSuccess(ctx context.Context, callbackParams CallbackParams, indexDir string, repoID uint64)
type CallbackBody ¶
type CallbackBody struct {
Name string `json:"name"`
Success bool `json:"success"`
Payload any `json:"payload"`
AdditionalPayload *AdditionalPayload `json:"additional_payload,omitempty"`
Error string `json:"error,omitempty"`
}
type CallbackFunc ¶
type CallbackFunc struct {
OnSuccess func(CallbackParams)
OnFailure func(CallbackParams, error)
}
type CallbackParams ¶
Click to show internal directories.
Click to hide internal directories.