Documentation ¶
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"`
}
This 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 ¶
func NewCallbackApi ¶
func NewCallbackApi(gitlabUrl, nodeUUID, secretFilePath string, client *http.Client) (*CallbackApi, error)
func (*CallbackApi) SendFailure ¶
func (c *CallbackApi) SendFailure(ctx context.Context, callbackParams CallbackParams, indexDir string, repoID uint32, failureReason error)
func (*CallbackApi) SendSuccess ¶
func (c *CallbackApi) SendSuccess(ctx context.Context, callbackParams CallbackParams, indexDir string, repoID uint32)
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.