Documentation ¶
Index ¶
- Variables
- type Incident
- type IncidentBuilderFunc
- func (b IncidentBuilderFunc) CreatedAt(value time.Time) func(*Incident) []string
- func (b IncidentBuilderFunc) ID(value string) func(*Incident) []string
- func (b IncidentBuilderFunc) Organisation(value *Organisation) func(*Incident) []string
- func (b IncidentBuilderFunc) OrganisationID(value string) func(*Incident) []string
- type IncidentMatcherFunc
- func (b IncidentMatcherFunc) CreatedAt(value time.Time) func(*Incident, *gstruct.Fields)
- func (b IncidentMatcherFunc) ID(value string) func(*Incident, *gstruct.Fields)
- func (b IncidentMatcherFunc) Match() IncidentMatcherMatchers
- func (b IncidentMatcherFunc) MatchCreatedAt(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
- func (b IncidentMatcherFunc) MatchID(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
- func (b IncidentMatcherFunc) MatchOrganisation(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
- func (b IncidentMatcherFunc) MatchOrganisationID(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
- func (b IncidentMatcherFunc) Organisation(value *Organisation) func(*Incident, *gstruct.Fields)
- func (b IncidentMatcherFunc) OrganisationID(value string) func(*Incident, *gstruct.Fields)
- type IncidentMatcherMatchers
- func (b IncidentMatcherMatchers) CreatedAt(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
- func (b IncidentMatcherMatchers) ID(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
- func (b IncidentMatcherMatchers) Organisation(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
- func (b IncidentMatcherMatchers) OrganisationID(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
- type Organisation
- type OrganisationBuilderFunc
- func (b OrganisationBuilderFunc) BoolFlag(value bool) func(*Organisation) []string
- func (b OrganisationBuilderFunc) ID(value string) func(*Organisation) []string
- func (b OrganisationBuilderFunc) Name(value string) func(*Organisation) []string
- func (b OrganisationBuilderFunc) OptionalString(value null.String) func(*Organisation) []string
- type OrganisationMatcherFunc
- func (b OrganisationMatcherFunc) BoolFlag(value bool) func(*Organisation, *gstruct.Fields)
- func (b OrganisationMatcherFunc) ID(value string) func(*Organisation, *gstruct.Fields)
- func (b OrganisationMatcherFunc) Match() OrganisationMatcherMatchers
- func (b OrganisationMatcherFunc) MatchBoolFlag(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
- func (b OrganisationMatcherFunc) MatchID(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
- func (b OrganisationMatcherFunc) MatchName(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
- func (b OrganisationMatcherFunc) MatchOptionalString(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
- func (b OrganisationMatcherFunc) Name(value string) func(*Organisation, *gstruct.Fields)
- func (b OrganisationMatcherFunc) OptionalString(value null.String) func(*Organisation, *gstruct.Fields)
- type OrganisationMatcherMatchers
- func (b OrganisationMatcherMatchers) BoolFlag(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
- func (b OrganisationMatcherMatchers) ID(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
- func (b OrganisationMatcherMatchers) Name(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
- func (b OrganisationMatcherMatchers) OptionalString(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
Constants ¶
This section is empty.
Variables ¶
var IncidentBuilder = IncidentBuilderFunc(func(opts ...func(*Incident) []string) partial.Partial[Incident] { apply := func(base Incident) partial.Partial[Incident] { model := partial.Partial[Incident]{ Subject: base, FieldNames: []string{}, } for _, opt := range opts { model.FieldNames = append(model.FieldNames, opt(&model.Subject)...) } return model } model := apply(Incident{}) model.SetApply(func(base Incident) *Incident { patched := apply(base).Subject return &patched }) return model })
IncidentBuilder initialises a Incident struct with fields from the given setters. Setters are applied first to last, with subsequent sets taking precedence.
var IncidentMatcher = IncidentMatcherFunc(func(opts ...func(*Incident, *gstruct.Fields)) types.GomegaMatcher { fields := gstruct.Fields{} for _, opt := range opts { opt(nil, &fields) } return gstruct.PointTo( gstruct.MatchFields(gstruct.IgnoreExtras, fields), ) })
IncidentMatcher creates a Gomega matcher for Incident against the given fields. Matchers are applied first to last, with subsequent matchers taking precedence.
var OrganisationBuilder = OrganisationBuilderFunc(func(opts ...func(*Organisation) []string) partial.Partial[Organisation] { apply := func(base Organisation) partial.Partial[Organisation] { model := partial.Partial[Organisation]{ Subject: base, FieldNames: []string{}, } for _, opt := range opts { model.FieldNames = append(model.FieldNames, opt(&model.Subject)...) } return model } model := apply(Organisation{}) model.SetApply(func(base Organisation) *Organisation { patched := apply(base).Subject return &patched }) return model })
OrganisationBuilder initialises a Organisation struct with fields from the given setters. Setters are applied first to last, with subsequent sets taking precedence.
var OrganisationMatcher = OrganisationMatcherFunc(func(opts ...func(*Organisation, *gstruct.Fields)) types.GomegaMatcher { fields := gstruct.Fields{} for _, opt := range opts { opt(nil, &fields) } return gstruct.PointTo( gstruct.MatchFields(gstruct.IgnoreExtras, fields), ) })
OrganisationMatcher creates a Gomega matcher for Organisation against the given fields. Matchers are applied first to last, with subsequent matchers taking precedence.
Functions ¶
This section is empty.
Types ¶
type Incident ¶
type Incident struct { ID string `json:"id" gorm:"type:text;primaryKey;default:generate_ulid()"` OrganisationID string `json:"organisation_id"` Organisation *Organisation CreatedAt time.Time `json:"created_at"` }
codegen-partial:builder,matcher
type IncidentBuilderFunc ¶
func (IncidentBuilderFunc) CreatedAt ¶
func (b IncidentBuilderFunc) CreatedAt(value time.Time) func(*Incident) []string
func (IncidentBuilderFunc) ID ¶
func (b IncidentBuilderFunc) ID(value string) func(*Incident) []string
func (IncidentBuilderFunc) Organisation ¶
func (b IncidentBuilderFunc) Organisation(value *Organisation) func(*Incident) []string
func (IncidentBuilderFunc) OrganisationID ¶
func (b IncidentBuilderFunc) OrganisationID(value string) func(*Incident) []string
type IncidentMatcherFunc ¶
type IncidentMatcherFunc func(opts ...func(*Incident, *gstruct.Fields)) types.GomegaMatcher
func (IncidentMatcherFunc) ID ¶
func (b IncidentMatcherFunc) ID(value string) func(*Incident, *gstruct.Fields)
func (IncidentMatcherFunc) Match ¶
func (b IncidentMatcherFunc) Match() IncidentMatcherMatchers
Match returns an interface with the same methods as the base matcher, but accepting GomegaMatcher parameters instead of the exact equality matches.
func (IncidentMatcherFunc) MatchCreatedAt ¶
func (b IncidentMatcherFunc) MatchCreatedAt(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
func (IncidentMatcherFunc) MatchID ¶
func (b IncidentMatcherFunc) MatchID(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
func (IncidentMatcherFunc) MatchOrganisation ¶
func (b IncidentMatcherFunc) MatchOrganisation(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
func (IncidentMatcherFunc) MatchOrganisationID ¶
func (b IncidentMatcherFunc) MatchOrganisationID(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
func (IncidentMatcherFunc) Organisation ¶
func (b IncidentMatcherFunc) Organisation(value *Organisation) func(*Incident, *gstruct.Fields)
func (IncidentMatcherFunc) OrganisationID ¶
func (b IncidentMatcherFunc) OrganisationID(value string) func(*Incident, *gstruct.Fields)
type IncidentMatcherMatchers ¶
type IncidentMatcherMatchers struct{}
func (IncidentMatcherMatchers) CreatedAt ¶
func (b IncidentMatcherMatchers) CreatedAt(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
func (IncidentMatcherMatchers) ID ¶
func (b IncidentMatcherMatchers) ID(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
func (IncidentMatcherMatchers) Organisation ¶
func (b IncidentMatcherMatchers) Organisation(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
func (IncidentMatcherMatchers) OrganisationID ¶
func (b IncidentMatcherMatchers) OrganisationID(value types.GomegaMatcher) func(*Incident, *gstruct.Fields)
type Organisation ¶
type Organisation struct { ID string `json:"id" gorm:"type:text;primaryKey;default:generate_ulid()"` Name string `json:"name"` OptionalString null.String `json:"optional_string"` BoolFlag bool `json:"bool_flag"` }
codegen-partial:builder,matcher
func (Organisation) Matcher ¶
func (b Organisation) Matcher(opts ...func(*Organisation, *gstruct.Fields)) types.GomegaMatcher
Matcher is added to the base type, permitting other generic functions to build matchers from each of the matcher-setter functions.
type OrganisationBuilderFunc ¶
type OrganisationBuilderFunc func(opts ...func(*Organisation) []string) partial.Partial[Organisation]
func (OrganisationBuilderFunc) BoolFlag ¶
func (b OrganisationBuilderFunc) BoolFlag(value bool) func(*Organisation) []string
func (OrganisationBuilderFunc) ID ¶
func (b OrganisationBuilderFunc) ID(value string) func(*Organisation) []string
func (OrganisationBuilderFunc) Name ¶
func (b OrganisationBuilderFunc) Name(value string) func(*Organisation) []string
func (OrganisationBuilderFunc) OptionalString ¶
func (b OrganisationBuilderFunc) OptionalString(value null.String) func(*Organisation) []string
type OrganisationMatcherFunc ¶
type OrganisationMatcherFunc func(opts ...func(*Organisation, *gstruct.Fields)) types.GomegaMatcher
func (OrganisationMatcherFunc) BoolFlag ¶
func (b OrganisationMatcherFunc) BoolFlag(value bool) func(*Organisation, *gstruct.Fields)
func (OrganisationMatcherFunc) ID ¶
func (b OrganisationMatcherFunc) ID(value string) func(*Organisation, *gstruct.Fields)
func (OrganisationMatcherFunc) Match ¶
func (b OrganisationMatcherFunc) Match() OrganisationMatcherMatchers
Match returns an interface with the same methods as the base matcher, but accepting GomegaMatcher parameters instead of the exact equality matches.
func (OrganisationMatcherFunc) MatchBoolFlag ¶
func (b OrganisationMatcherFunc) MatchBoolFlag(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
func (OrganisationMatcherFunc) MatchID ¶
func (b OrganisationMatcherFunc) MatchID(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
func (OrganisationMatcherFunc) MatchName ¶
func (b OrganisationMatcherFunc) MatchName(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
func (OrganisationMatcherFunc) MatchOptionalString ¶
func (b OrganisationMatcherFunc) MatchOptionalString(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
func (OrganisationMatcherFunc) Name ¶
func (b OrganisationMatcherFunc) Name(value string) func(*Organisation, *gstruct.Fields)
func (OrganisationMatcherFunc) OptionalString ¶
func (b OrganisationMatcherFunc) OptionalString(value null.String) func(*Organisation, *gstruct.Fields)
type OrganisationMatcherMatchers ¶
type OrganisationMatcherMatchers struct{}
func (OrganisationMatcherMatchers) BoolFlag ¶
func (b OrganisationMatcherMatchers) BoolFlag(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
func (OrganisationMatcherMatchers) ID ¶
func (b OrganisationMatcherMatchers) ID(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
func (OrganisationMatcherMatchers) Name ¶
func (b OrganisationMatcherMatchers) Name(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)
func (OrganisationMatcherMatchers) OptionalString ¶
func (b OrganisationMatcherMatchers) OptionalString(value types.GomegaMatcher) func(*Organisation, *gstruct.Fields)