Documentation
¶
Index ¶
- func PhaseValidator(p Phase) error
- type ArrayConvertExample
- type ArrayExample
- type Cron
- type CustomConvertExample
- type Customer
- type Detail
- type EnumExample
- type Event
- type EventCreate
- func (c *EventCreate) AddTagIDs(ids ...int) *EventCreate
- func (c *EventCreate) SetAt(v time.Time) *EventCreate
- func (c *EventCreate) SetCustomer(v *Customer) *EventCreate
- func (c *EventCreate) SetCustomerID(v int64) *EventCreate
- func (c *EventCreate) SetDeletedAt(v time.Time) *EventCreate
- func (c *EventCreate) SetID(v string) *EventCreate
- func (c *EventCreate) SetLevel(v int) *EventCreate
- func (c *EventCreate) SetNillableDeletedAt(v *time.Time) *EventCreate
- func (c *EventCreate) SetNillableNote(v *string) *EventCreate
- func (c *EventCreate) SetNillableRetiredAt(v *time.Time) *EventCreate
- func (c *EventCreate) SetNote(v string) *EventCreate
- func (c *EventCreate) SetOwner(v string) *EventCreate
- func (c *EventCreate) SetRetiredAt(v time.Time) *EventCreate
- type Item
- type Job
- type JobSlice
- type NamedSliceExample
- type OptionalExample
- type Order
- type OrderEdges
- type Phase
- type PointerSliceExample
- type Snapshot
- type SnapshotExample
- type Status
- type StringSlice
- type Task
- type Transition
- type TransitionSlice
- type User
- type UserWithRoles
- type Visibility
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PhaseValidator ¶
PhaseValidator reports a value Phase does not declare
Types ¶
type ArrayConvertExample ¶
ArrayConvertExample demonstrates a fixed-size array whose elements need a conversion, rather than being assignable as they are
type ArrayExample ¶
ArrayExample demonstrates fixed-size array support
type Cron ¶
type Cron struct {
ID string `boil:"id" json:"id" toml:"id" yaml:"id"`
CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
UpdatedAt null.Time `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`
Schedule string `boil:"schedule" json:"schedule" toml:"schedule" yaml:"schedule"`
DataType string `boil:"data_type" json:"data_type" toml:"data_type" yaml:"data_type"`
Data []byte `boil:"data" json:"data" toml:"data" yaml:"data"`
Queue string `boil:"queue" json:"queue" toml:"queue" yaml:"queue"`
SkipExecution bool `boil:"skip_execution" json:"skip_execution" toml:"skip_execution" yaml:"skip_execution"`
StartTime time.Time `boil:"start_time" json:"start_time" toml:"start_time" yaml:"start_time"`
R *cronR `boil:"-" json:"-" toml:"-" yaml:"-"`
L cronL `boil:"-" json:"-" toml:"-" yaml:"-"`
}
Cron is an object representing the database table.
type CustomConvertExample ¶
CustomConvertExample demonstrates the using: directive
type EnumExample ¶
type EnumExample struct {
ID string
Status Status
Visibility Visibility
}
EnumExample demonstrates enum mapping
type Event ¶
type Event struct {
ID string
At time.Time
Owner string
OwnerID int64
Level int
RetiredAt *time.Time
Deadline *time.Time
Note *string
}
Event demonstrates conversions the generator derives on its own: a time read through a method, a string carried as bytes and an int onto a named integer type
type EventCreate ¶
EventCreate mimics the builder ent generates for an entity: a setter per column, a nillable twin for each optional column, both forms of an edge setter and a variadic adder for a to-many edge. Values records what was set.
func (*EventCreate) AddTagIDs ¶
func (c *EventCreate) AddTagIDs(ids ...int) *EventCreate
AddTagIDs adds to the "tags" edge by ids
func (*EventCreate) SetAt ¶
func (c *EventCreate) SetAt(v time.Time) *EventCreate
SetAt sets the "at" column
func (*EventCreate) SetCustomer ¶
func (c *EventCreate) SetCustomer(v *Customer) *EventCreate
SetCustomer sets the "customer" edge to an entity
func (*EventCreate) SetCustomerID ¶
func (c *EventCreate) SetCustomerID(v int64) *EventCreate
SetCustomerID sets the "customer" edge by id
func (*EventCreate) SetDeletedAt ¶
func (c *EventCreate) SetDeletedAt(v time.Time) *EventCreate
SetDeletedAt sets the optional "deleted_at" column
func (*EventCreate) SetID ¶
func (c *EventCreate) SetID(v string) *EventCreate
SetID sets the "id" column
func (*EventCreate) SetLevel ¶
func (c *EventCreate) SetLevel(v int) *EventCreate
SetLevel sets the "level" column
func (*EventCreate) SetNillableDeletedAt ¶
func (c *EventCreate) SetNillableDeletedAt(v *time.Time) *EventCreate
SetNillableDeletedAt sets the "deleted_at" column if v is not nil
func (*EventCreate) SetNillableNote ¶
func (c *EventCreate) SetNillableNote(v *string) *EventCreate
SetNillableNote sets the "note" column if v is not nil
func (*EventCreate) SetNillableRetiredAt ¶
func (c *EventCreate) SetNillableRetiredAt(v *time.Time) *EventCreate
SetNillableRetiredAt sets the "retired_at" column if v is not nil
func (*EventCreate) SetNote ¶
func (c *EventCreate) SetNote(v string) *EventCreate
SetNote sets the optional "note" column
func (*EventCreate) SetOwner ¶
func (c *EventCreate) SetOwner(v string) *EventCreate
SetOwner sets the "owner" column
func (*EventCreate) SetRetiredAt ¶
func (c *EventCreate) SetRetiredAt(v time.Time) *EventCreate
SetRetiredAt sets the optional "retired_at" column
type Job ¶
type Job struct {
ID string `boil:"id" json:"id" toml:"id" yaml:"id"`
CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
UpdatedAt null.Time `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"`
RunAt time.Time `boil:"run_at" json:"run_at" toml:"run_at" yaml:"run_at"`
Group null.String `boil:"group" json:"group,omitempty" toml:"group" yaml:"group,omitempty"`
Queue string `boil:"queue" json:"queue" toml:"queue" yaml:"queue"`
DataType string `boil:"data_type" json:"data_type" toml:"data_type" yaml:"data_type"`
Data []byte `boil:"data" json:"data" toml:"data" yaml:"data"`
ExternalID null.String `boil:"external_id" json:"external_id,omitempty" toml:"external_id" yaml:"external_id,omitempty"`
CronID null.String `boil:"cron_id" json:"cron_id,omitempty" toml:"cron_id" yaml:"cron_id,omitempty"`
R *jobR `boil:"-" json:"-" toml:"-" yaml:"-"`
L jobL `boil:"-" json:"-" toml:"-" yaml:"-"`
}
Job is an object representing the database table.
type NamedSliceExample ¶
type NamedSliceExample struct {
ID string
Items StringSlice
}
NamedSliceExample demonstrates named slice type support
type OptionalExample ¶
OptionalExample demonstrates optional nested values: a nil field stays nil
type Order ¶
type Order struct {
ID string
Edges OrderEdges
}
Order demonstrates a from: path that crosses an edge
type OrderEdges ¶
type OrderEdges struct {
Customer *Customer
}
OrderEdges mirrors the Edges struct ent generates: the pointer is nil unless the edge was loaded, and the OrErr accessor reports that instead of a nil dereference
func (OrderEdges) CustomerOrErr ¶
func (e OrderEdges) CustomerOrErr() (*Customer, error)
CustomerOrErr is the accessor ent generates for an edge
type Phase ¶
type Phase string
Phase is a string enum shaped like the ones ent generates, with its values under the type name and a validator next to them
type PointerSliceExample ¶
PointerSliceExample demonstrates a repeated field of pointers, the shape a protobuf `repeated Item` message field takes on the Go side
type SnapshotExample ¶
SnapshotExample demonstrates using: with a converter over a named struct
type Status ¶
type Status string
Status is a named string enum. Its values line up with protos.StatusProto, so a conversion between the two is derived automatically without any annotation.
type Transition ¶
type Transition struct {
ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"`
JobID string `boil:"job_id" json:"job_id" toml:"job_id" yaml:"job_id"`
CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
State string `boil:"state" json:"state" toml:"state" yaml:"state"`
Attempts int `boil:"attempts" json:"attempts" toml:"attempts" yaml:"attempts"`
RetryAt null.Time `boil:"retry_at" json:"retry_at,omitempty" toml:"retry_at" yaml:"retry_at,omitempty"`
R *transitionR `boil:"-" json:"-" toml:"-" yaml:"-"`
L transitionL `boil:"-" json:"-" toml:"-" yaml:"-"`
}
Transition is an object representing the database table.
type TransitionSlice ¶
type TransitionSlice []*Transition
type UserWithRoles ¶
type UserWithRoles struct {
ID string
Name string
Roles []string
Tags map[string]string
Scores []int
Metadata map[string]int
}
UserWithRoles demonstrates slice and map fields
type Visibility ¶
type Visibility string
Visibility is a named string enum whose counterpart uses different values, so a mapping has to be spelled out with the map: directive
const ( VisibilityUnspecified Visibility = "" VisibilityPublic Visibility = "public" VisibilityPrivate Visibility = "private" )