MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / Validate

Method Validate

app/controlplane/pkg/biz/orgmetrics.go:69–75  ·  view source on GitHub ↗

Validate validates the time window checking From and To are set

()

Source from the content-addressed store, hash-verified

67
68// Validate validates the time window checking From and To are set
69func (tw *TimeWindow) Validate() error {
70 if tw.From.IsZero() || tw.To.IsZero() {
71 return NewErrInvalidTimeWindowStr("from and to time must be set in time window")
72 }
73
74 return nil
75}
76
77func NewOrgMetricsUseCase(r OrgMetricsRepo, orgRepo OrganizationRepo, wfUseCase *WorkflowUseCase, l log.Logger) (*OrgMetricsUseCase, error) {
78 return &OrgMetricsUseCase{

Callers 13

IsReadyMethod · 0.45
validateTimeWindowIsSetFunction · 0.45
FieldsMethod · 0.45
FieldsMethod · 0.45
FieldsMethod · 0.45
mainFunction · 0.45
TestValidatePolicyFunction · 0.45
TestValidatePolicyGroupFunction · 0.45
TestValidateAnnotationsFunction · 0.45
TestPolicyAttachmentFunction · 0.45
TestJWTAuthFuncFunction · 0.45

Calls 1

Tested by 5

TestValidatePolicyFunction · 0.36
TestValidatePolicyGroupFunction · 0.36
TestValidateAnnotationsFunction · 0.36
TestPolicyAttachmentFunction · 0.36
TestJWTAuthFuncFunction · 0.36