Documentation
¶
Index ¶
- Variables
- func ProvideCheckSanitizers() map[enum.CheckPayloadKind]func(in *ReportInput, s *auth.Session) error
- func SanitizeJSONPayload(source json.RawMessage, data any) (json.RawMessage, error)
- type Controller
- func (c *Controller) ListChecks(ctx context.Context, session *auth.Session, repoRef string, commitSHA string, ...) ([]types.Check, int, error)
- func (c *Controller) ListRecentChecks(ctx context.Context, session *auth.Session, repoRef string, ...) ([]string, error)
- func (c *Controller) Report(ctx context.Context, session *auth.Session, repoRef string, commitSHA string, ...) (*types.Check, error)
- type ReportInput
Constants ¶
This section is empty.
Variables ¶
View Source
var WireSet = wire.NewSet( ProvideCheckSanitizers, ProvideController, )
WireSet provides a wire set for this package.
Functions ¶
func ProvideCheckSanitizers ¶
func ProvideCheckSanitizers() map[enum.CheckPayloadKind]func(in *ReportInput, s *auth.Session) error
func SanitizeJSONPayload ¶
func SanitizeJSONPayload(source json.RawMessage, data any) (json.RawMessage, error)
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController( tx dbtx.Transactor, authorizer authz.Authorizer, repoStore store.RepoStore, checkStore store.CheckStore, git git.Interface, sanitizers map[enum.CheckPayloadKind]func(in *ReportInput, s *auth.Session) error, ) *Controller
func ProvideController ¶
func ProvideController( tx dbtx.Transactor, authorizer authz.Authorizer, repoStore store.RepoStore, checkStore store.CheckStore, rpcClient git.Interface, sanitizers map[enum.CheckPayloadKind]func(in *ReportInput, s *auth.Session) error, ) *Controller
func (*Controller) ListChecks ¶
func (c *Controller) ListChecks( ctx context.Context, session *auth.Session, repoRef string, commitSHA string, opts types.CheckListOptions, ) ([]types.Check, int, error)
ListChecks return an array of status check results for a commit in a repository.
func (*Controller) ListRecentChecks ¶
func (c *Controller) ListRecentChecks( ctx context.Context, session *auth.Session, repoRef string, opts types.CheckRecentOptions, ) ([]string, error)
ListRecentChecks return an array of status check UIDs that have been run recently.
func (*Controller) Report ¶
func (c *Controller) Report( ctx context.Context, session *auth.Session, repoRef string, commitSHA string, in *ReportInput, metadata map[string]string, ) (*types.Check, error)
Report modifies an existing or creates a new (if none yet exists) status check report for a specific commit.
type ReportInput ¶
type ReportInput struct { // TODO [CODE-1363]: remove after identifier migration. CheckUID string `json:"check_uid" deprecated:"true"` Identifier string `json:"identifier"` Status enum.CheckStatus `json:"status"` Summary string `json:"summary"` Link string `json:"link"` Payload types.CheckPayload `json:"payload"` Started int64 `json:"started,omitempty"` Ended int64 `json:"ended,omitempty"` }
func (*ReportInput) Sanitize ¶
func (in *ReportInput) Sanitize( sanitizers map[enum.CheckPayloadKind]func(in *ReportInput, s *auth.Session) error, session *auth.Session, ) error
Sanitize validates and sanitizes the ReportInput data.
Click to show internal directories.
Click to hide internal directories.