Documentation
¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type LogEvent
- type LogEventClient
- func (c *LogEventClient) Create() *LogEventCreate
- func (c *LogEventClient) CreateBulk(builders ...*LogEventCreate) *LogEventCreateBulk
- func (c *LogEventClient) Delete() *LogEventDelete
- func (c *LogEventClient) DeleteOne(le *LogEvent) *LogEventDeleteOne
- func (c *LogEventClient) DeleteOneID(id int) *LogEventDeleteOne
- func (c *LogEventClient) Get(ctx context.Context, id int) (*LogEvent, error)
- func (c *LogEventClient) GetX(ctx context.Context, id int) *LogEvent
- func (c *LogEventClient) Hooks() []Hook
- func (c *LogEventClient) Query() *LogEventQuery
- func (c *LogEventClient) Update() *LogEventUpdate
- func (c *LogEventClient) UpdateOne(le *LogEvent) *LogEventUpdateOne
- func (c *LogEventClient) UpdateOneID(id int) *LogEventUpdateOne
- func (c *LogEventClient) Use(hooks ...Hook)
- type LogEventCreate
- func (lec *LogEventCreate) Exec(ctx context.Context) error
- func (lec *LogEventCreate) ExecX(ctx context.Context)
- func (lec *LogEventCreate) Mutation() *LogEventMutation
- func (lec *LogEventCreate) Save(ctx context.Context) (*LogEvent, error)
- func (lec *LogEventCreate) SaveX(ctx context.Context) *LogEvent
- func (lec *LogEventCreate) SetLevel(i int) *LogEventCreate
- func (lec *LogEventCreate) SetMessage(s string) *LogEventCreate
- func (lec *LogEventCreate) SetTimestamp(t time.Time) *LogEventCreate
- type LogEventCreateBulk
- type LogEventDelete
- type LogEventDeleteOne
- type LogEventGroupBy
- func (legb *LogEventGroupBy) Aggregate(fns ...AggregateFunc) *LogEventGroupBy
- func (s *LogEventGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *LogEventGroupBy) BoolX(ctx context.Context) bool
- func (s *LogEventGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *LogEventGroupBy) BoolsX(ctx context.Context) []bool
- func (s *LogEventGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *LogEventGroupBy) Float64X(ctx context.Context) float64
- func (s *LogEventGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *LogEventGroupBy) Float64sX(ctx context.Context) []float64
- func (s *LogEventGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *LogEventGroupBy) IntX(ctx context.Context) int
- func (s *LogEventGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *LogEventGroupBy) IntsX(ctx context.Context) []int
- func (legb *LogEventGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *LogEventGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *LogEventGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *LogEventGroupBy) StringX(ctx context.Context) string
- func (s *LogEventGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *LogEventGroupBy) StringsX(ctx context.Context) []string
- type LogEventMutation
- func (m *LogEventMutation) AddField(name string, value ent.Value) error
- func (m *LogEventMutation) AddLevel(i int)
- func (m *LogEventMutation) AddedEdges() []string
- func (m *LogEventMutation) AddedField(name string) (ent.Value, bool)
- func (m *LogEventMutation) AddedFields() []string
- func (m *LogEventMutation) AddedIDs(name string) []ent.Value
- func (m *LogEventMutation) AddedLevel() (r int, exists bool)
- func (m *LogEventMutation) ClearEdge(name string) error
- func (m *LogEventMutation) ClearField(name string) error
- func (m *LogEventMutation) ClearedEdges() []string
- func (m *LogEventMutation) ClearedFields() []string
- func (m LogEventMutation) Client() *Client
- func (m *LogEventMutation) EdgeCleared(name string) bool
- func (m *LogEventMutation) Field(name string) (ent.Value, bool)
- func (m *LogEventMutation) FieldCleared(name string) bool
- func (m *LogEventMutation) Fields() []string
- func (m *LogEventMutation) ID() (id int, exists bool)
- func (m *LogEventMutation) IDs(ctx context.Context) ([]int, error)
- func (m *LogEventMutation) Level() (r int, exists bool)
- func (m *LogEventMutation) Message() (r string, exists bool)
- func (m *LogEventMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *LogEventMutation) OldLevel(ctx context.Context) (v int, err error)
- func (m *LogEventMutation) OldMessage(ctx context.Context) (v string, err error)
- func (m *LogEventMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)
- func (m *LogEventMutation) Op() Op
- func (m *LogEventMutation) RemovedEdges() []string
- func (m *LogEventMutation) RemovedIDs(name string) []ent.Value
- func (m *LogEventMutation) ResetEdge(name string) error
- func (m *LogEventMutation) ResetField(name string) error
- func (m *LogEventMutation) ResetLevel()
- func (m *LogEventMutation) ResetMessage()
- func (m *LogEventMutation) ResetTimestamp()
- func (m *LogEventMutation) SetField(name string, value ent.Value) error
- func (m *LogEventMutation) SetLevel(i int)
- func (m *LogEventMutation) SetMessage(s string)
- func (m *LogEventMutation) SetTimestamp(t time.Time)
- func (m *LogEventMutation) Timestamp() (r time.Time, exists bool)
- func (m LogEventMutation) Tx() (*Tx, error)
- func (m *LogEventMutation) Type() string
- func (m *LogEventMutation) Where(ps ...predicate.LogEvent)
- type LogEventQuery
- func (leq *LogEventQuery) All(ctx context.Context) ([]*LogEvent, error)
- func (leq *LogEventQuery) AllX(ctx context.Context) []*LogEvent
- func (leq *LogEventQuery) Clone() *LogEventQuery
- func (leq *LogEventQuery) Count(ctx context.Context) (int, error)
- func (leq *LogEventQuery) CountX(ctx context.Context) int
- func (leq *LogEventQuery) Exist(ctx context.Context) (bool, error)
- func (leq *LogEventQuery) ExistX(ctx context.Context) bool
- func (leq *LogEventQuery) First(ctx context.Context) (*LogEvent, error)
- func (leq *LogEventQuery) FirstID(ctx context.Context) (id int, err error)
- func (leq *LogEventQuery) FirstIDX(ctx context.Context) int
- func (leq *LogEventQuery) FirstX(ctx context.Context) *LogEvent
- func (leq *LogEventQuery) GroupBy(field string, fields ...string) *LogEventGroupBy
- func (leq *LogEventQuery) IDs(ctx context.Context) ([]int, error)
- func (leq *LogEventQuery) IDsX(ctx context.Context) []int
- func (leq *LogEventQuery) Limit(limit int) *LogEventQuery
- func (leq *LogEventQuery) Offset(offset int) *LogEventQuery
- func (leq *LogEventQuery) Only(ctx context.Context) (*LogEvent, error)
- func (leq *LogEventQuery) OnlyID(ctx context.Context) (id int, err error)
- func (leq *LogEventQuery) OnlyIDX(ctx context.Context) int
- func (leq *LogEventQuery) OnlyX(ctx context.Context) *LogEvent
- func (leq *LogEventQuery) Order(o ...OrderFunc) *LogEventQuery
- func (leq *LogEventQuery) Select(fields ...string) *LogEventSelect
- func (leq *LogEventQuery) Unique(unique bool) *LogEventQuery
- func (leq *LogEventQuery) Where(ps ...predicate.LogEvent) *LogEventQuery
- type LogEventSelect
- func (s *LogEventSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *LogEventSelect) BoolX(ctx context.Context) bool
- func (s *LogEventSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *LogEventSelect) BoolsX(ctx context.Context) []bool
- func (s *LogEventSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *LogEventSelect) Float64X(ctx context.Context) float64
- func (s *LogEventSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *LogEventSelect) Float64sX(ctx context.Context) []float64
- func (s *LogEventSelect) Int(ctx context.Context) (_ int, err error)
- func (s *LogEventSelect) IntX(ctx context.Context) int
- func (s *LogEventSelect) Ints(ctx context.Context) ([]int, error)
- func (s *LogEventSelect) IntsX(ctx context.Context) []int
- func (les *LogEventSelect) Scan(ctx context.Context, v interface{}) error
- func (s *LogEventSelect) ScanX(ctx context.Context, v interface{})
- func (s *LogEventSelect) String(ctx context.Context) (_ string, err error)
- func (s *LogEventSelect) StringX(ctx context.Context) string
- func (s *LogEventSelect) Strings(ctx context.Context) ([]string, error)
- func (s *LogEventSelect) StringsX(ctx context.Context) []string
- type LogEventUpdate
- func (leu *LogEventUpdate) AddLevel(i int) *LogEventUpdate
- func (leu *LogEventUpdate) Exec(ctx context.Context) error
- func (leu *LogEventUpdate) ExecX(ctx context.Context)
- func (leu *LogEventUpdate) Mutation() *LogEventMutation
- func (leu *LogEventUpdate) Save(ctx context.Context) (int, error)
- func (leu *LogEventUpdate) SaveX(ctx context.Context) int
- func (leu *LogEventUpdate) SetLevel(i int) *LogEventUpdate
- func (leu *LogEventUpdate) SetMessage(s string) *LogEventUpdate
- func (leu *LogEventUpdate) SetTimestamp(t time.Time) *LogEventUpdate
- func (leu *LogEventUpdate) Where(ps ...predicate.LogEvent) *LogEventUpdate
- type LogEventUpdateOne
- func (leuo *LogEventUpdateOne) AddLevel(i int) *LogEventUpdateOne
- func (leuo *LogEventUpdateOne) Exec(ctx context.Context) error
- func (leuo *LogEventUpdateOne) ExecX(ctx context.Context)
- func (leuo *LogEventUpdateOne) Mutation() *LogEventMutation
- func (leuo *LogEventUpdateOne) Save(ctx context.Context) (*LogEvent, error)
- func (leuo *LogEventUpdateOne) SaveX(ctx context.Context) *LogEvent
- func (leuo *LogEventUpdateOne) Select(field string, fields ...string) *LogEventUpdateOne
- func (leuo *LogEventUpdateOne) SetLevel(i int) *LogEventUpdateOne
- func (leuo *LogEventUpdateOne) SetMessage(s string) *LogEventUpdateOne
- func (leuo *LogEventUpdateOne) SetTimestamp(t time.Time) *LogEventUpdateOne
- type LogEvents
- type Message
- type MessageClient
- func (c *MessageClient) Create() *MessageCreate
- func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk
- func (c *MessageClient) Delete() *MessageDelete
- func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne
- func (c *MessageClient) DeleteOneID(id int) *MessageDeleteOne
- func (c *MessageClient) Get(ctx context.Context, id int) (*Message, error)
- func (c *MessageClient) GetX(ctx context.Context, id int) *Message
- func (c *MessageClient) Hooks() []Hook
- func (c *MessageClient) Query() *MessageQuery
- func (c *MessageClient) Update() *MessageUpdate
- func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne
- func (c *MessageClient) UpdateOneID(id int) *MessageUpdateOne
- func (c *MessageClient) Use(hooks ...Hook)
- type MessageCreate
- func (mc *MessageCreate) Exec(ctx context.Context) error
- func (mc *MessageCreate) ExecX(ctx context.Context)
- func (mc *MessageCreate) Mutation() *MessageMutation
- func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)
- func (mc *MessageCreate) SaveX(ctx context.Context) *Message
- func (mc *MessageCreate) SetData(b []byte) *MessageCreate
- func (mc *MessageCreate) SetDestinationAddress(s string) *MessageCreate
- func (mc *MessageCreate) SetDestinationPort(i int) *MessageCreate
- func (mc *MessageCreate) SetNillableOpcode(i *int) *MessageCreate
- func (mc *MessageCreate) SetNillableServer(i *int) *MessageCreate
- func (mc *MessageCreate) SetNillableTimestampRaw(u *uint32) *MessageCreate
- func (mc *MessageCreate) SetOpcode(i int) *MessageCreate
- func (mc *MessageCreate) SetSegmentType(i int) *MessageCreate
- func (mc *MessageCreate) SetServer(i int) *MessageCreate
- func (mc *MessageCreate) SetSize(u uint32) *MessageCreate
- func (mc *MessageCreate) SetSourceActor(u uint32) *MessageCreate
- func (mc *MessageCreate) SetSourceAddress(s string) *MessageCreate
- func (mc *MessageCreate) SetSourcePort(i int) *MessageCreate
- func (mc *MessageCreate) SetTargetActor(u uint32) *MessageCreate
- func (mc *MessageCreate) SetTimestamp(t time.Time) *MessageCreate
- func (mc *MessageCreate) SetTimestampRaw(u uint32) *MessageCreate
- func (mc *MessageCreate) SetVersion(i int) *MessageCreate
- type MessageCreateBulk
- type MessageDelete
- type MessageDeleteOne
- type MessageGroupBy
- func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy
- func (s *MessageGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *MessageGroupBy) BoolX(ctx context.Context) bool
- func (s *MessageGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *MessageGroupBy) BoolsX(ctx context.Context) []bool
- func (s *MessageGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *MessageGroupBy) Float64X(ctx context.Context) float64
- func (s *MessageGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *MessageGroupBy) Float64sX(ctx context.Context) []float64
- func (s *MessageGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *MessageGroupBy) IntX(ctx context.Context) int
- func (s *MessageGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *MessageGroupBy) IntsX(ctx context.Context) []int
- func (mgb *MessageGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *MessageGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *MessageGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *MessageGroupBy) StringX(ctx context.Context) string
- func (s *MessageGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *MessageGroupBy) StringsX(ctx context.Context) []string
- type MessageMutation
- func (m *MessageMutation) AddDestinationPort(i int)
- func (m *MessageMutation) AddField(name string, value ent.Value) error
- func (m *MessageMutation) AddOpcode(i int)
- func (m *MessageMutation) AddSegmentType(i int)
- func (m *MessageMutation) AddServer(i int)
- func (m *MessageMutation) AddSize(u int32)
- func (m *MessageMutation) AddSourceActor(u int32)
- func (m *MessageMutation) AddSourcePort(i int)
- func (m *MessageMutation) AddTargetActor(u int32)
- func (m *MessageMutation) AddTimestampRaw(u int32)
- func (m *MessageMutation) AddVersion(i int)
- func (m *MessageMutation) AddedDestinationPort() (r int, exists bool)
- func (m *MessageMutation) AddedEdges() []string
- func (m *MessageMutation) AddedField(name string) (ent.Value, bool)
- func (m *MessageMutation) AddedFields() []string
- func (m *MessageMutation) AddedIDs(name string) []ent.Value
- func (m *MessageMutation) AddedOpcode() (r int, exists bool)
- func (m *MessageMutation) AddedSegmentType() (r int, exists bool)
- func (m *MessageMutation) AddedServer() (r int, exists bool)
- func (m *MessageMutation) AddedSize() (r int32, exists bool)
- func (m *MessageMutation) AddedSourceActor() (r int32, exists bool)
- func (m *MessageMutation) AddedSourcePort() (r int, exists bool)
- func (m *MessageMutation) AddedTargetActor() (r int32, exists bool)
- func (m *MessageMutation) AddedTimestampRaw() (r int32, exists bool)
- func (m *MessageMutation) AddedVersion() (r int, exists bool)
- func (m *MessageMutation) ClearData()
- func (m *MessageMutation) ClearEdge(name string) error
- func (m *MessageMutation) ClearField(name string) error
- func (m *MessageMutation) ClearOpcode()
- func (m *MessageMutation) ClearServer()
- func (m *MessageMutation) ClearTimestampRaw()
- func (m *MessageMutation) ClearedEdges() []string
- func (m *MessageMutation) ClearedFields() []string
- func (m MessageMutation) Client() *Client
- func (m *MessageMutation) Data() (r []byte, exists bool)
- func (m *MessageMutation) DataCleared() bool
- func (m *MessageMutation) DestinationAddress() (r string, exists bool)
- func (m *MessageMutation) DestinationPort() (r int, exists bool)
- func (m *MessageMutation) EdgeCleared(name string) bool
- func (m *MessageMutation) Field(name string) (ent.Value, bool)
- func (m *MessageMutation) FieldCleared(name string) bool
- func (m *MessageMutation) Fields() []string
- func (m *MessageMutation) ID() (id int, exists bool)
- func (m *MessageMutation) IDs(ctx context.Context) ([]int, error)
- func (m *MessageMutation) OldData(ctx context.Context) (v *[]byte, err error)
- func (m *MessageMutation) OldDestinationAddress(ctx context.Context) (v string, err error)
- func (m *MessageMutation) OldDestinationPort(ctx context.Context) (v int, err error)
- func (m *MessageMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *MessageMutation) OldOpcode(ctx context.Context) (v *int, err error)
- func (m *MessageMutation) OldSegmentType(ctx context.Context) (v int, err error)
- func (m *MessageMutation) OldServer(ctx context.Context) (v *int, err error)
- func (m *MessageMutation) OldSize(ctx context.Context) (v uint32, err error)
- func (m *MessageMutation) OldSourceActor(ctx context.Context) (v uint32, err error)
- func (m *MessageMutation) OldSourceAddress(ctx context.Context) (v string, err error)
- func (m *MessageMutation) OldSourcePort(ctx context.Context) (v int, err error)
- func (m *MessageMutation) OldTargetActor(ctx context.Context) (v uint32, err error)
- func (m *MessageMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)
- func (m *MessageMutation) OldTimestampRaw(ctx context.Context) (v *uint32, err error)
- func (m *MessageMutation) OldVersion(ctx context.Context) (v int, err error)
- func (m *MessageMutation) Op() Op
- func (m *MessageMutation) Opcode() (r int, exists bool)
- func (m *MessageMutation) OpcodeCleared() bool
- func (m *MessageMutation) RemovedEdges() []string
- func (m *MessageMutation) RemovedIDs(name string) []ent.Value
- func (m *MessageMutation) ResetData()
- func (m *MessageMutation) ResetDestinationAddress()
- func (m *MessageMutation) ResetDestinationPort()
- func (m *MessageMutation) ResetEdge(name string) error
- func (m *MessageMutation) ResetField(name string) error
- func (m *MessageMutation) ResetOpcode()
- func (m *MessageMutation) ResetSegmentType()
- func (m *MessageMutation) ResetServer()
- func (m *MessageMutation) ResetSize()
- func (m *MessageMutation) ResetSourceActor()
- func (m *MessageMutation) ResetSourceAddress()
- func (m *MessageMutation) ResetSourcePort()
- func (m *MessageMutation) ResetTargetActor()
- func (m *MessageMutation) ResetTimestamp()
- func (m *MessageMutation) ResetTimestampRaw()
- func (m *MessageMutation) ResetVersion()
- func (m *MessageMutation) SegmentType() (r int, exists bool)
- func (m *MessageMutation) Server() (r int, exists bool)
- func (m *MessageMutation) ServerCleared() bool
- func (m *MessageMutation) SetData(b []byte)
- func (m *MessageMutation) SetDestinationAddress(s string)
- func (m *MessageMutation) SetDestinationPort(i int)
- func (m *MessageMutation) SetField(name string, value ent.Value) error
- func (m *MessageMutation) SetOpcode(i int)
- func (m *MessageMutation) SetSegmentType(i int)
- func (m *MessageMutation) SetServer(i int)
- func (m *MessageMutation) SetSize(u uint32)
- func (m *MessageMutation) SetSourceActor(u uint32)
- func (m *MessageMutation) SetSourceAddress(s string)
- func (m *MessageMutation) SetSourcePort(i int)
- func (m *MessageMutation) SetTargetActor(u uint32)
- func (m *MessageMutation) SetTimestamp(t time.Time)
- func (m *MessageMutation) SetTimestampRaw(u uint32)
- func (m *MessageMutation) SetVersion(i int)
- func (m *MessageMutation) Size() (r uint32, exists bool)
- func (m *MessageMutation) SourceActor() (r uint32, exists bool)
- func (m *MessageMutation) SourceAddress() (r string, exists bool)
- func (m *MessageMutation) SourcePort() (r int, exists bool)
- func (m *MessageMutation) TargetActor() (r uint32, exists bool)
- func (m *MessageMutation) Timestamp() (r time.Time, exists bool)
- func (m *MessageMutation) TimestampRaw() (r uint32, exists bool)
- func (m *MessageMutation) TimestampRawCleared() bool
- func (m MessageMutation) Tx() (*Tx, error)
- func (m *MessageMutation) Type() string
- func (m *MessageMutation) Version() (r int, exists bool)
- func (m *MessageMutation) Where(ps ...predicate.Message)
- type MessageQuery
- func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)
- func (mq *MessageQuery) AllX(ctx context.Context) []*Message
- func (mq *MessageQuery) Clone() *MessageQuery
- func (mq *MessageQuery) Count(ctx context.Context) (int, error)
- func (mq *MessageQuery) CountX(ctx context.Context) int
- func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)
- func (mq *MessageQuery) ExistX(ctx context.Context) bool
- func (mq *MessageQuery) First(ctx context.Context) (*Message, error)
- func (mq *MessageQuery) FirstID(ctx context.Context) (id int, err error)
- func (mq *MessageQuery) FirstIDX(ctx context.Context) int
- func (mq *MessageQuery) FirstX(ctx context.Context) *Message
- func (mq *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy
- func (mq *MessageQuery) IDs(ctx context.Context) ([]int, error)
- func (mq *MessageQuery) IDsX(ctx context.Context) []int
- func (mq *MessageQuery) Limit(limit int) *MessageQuery
- func (mq *MessageQuery) Offset(offset int) *MessageQuery
- func (mq *MessageQuery) Only(ctx context.Context) (*Message, error)
- func (mq *MessageQuery) OnlyID(ctx context.Context) (id int, err error)
- func (mq *MessageQuery) OnlyIDX(ctx context.Context) int
- func (mq *MessageQuery) OnlyX(ctx context.Context) *Message
- func (mq *MessageQuery) Order(o ...OrderFunc) *MessageQuery
- func (mq *MessageQuery) Select(fields ...string) *MessageSelect
- func (mq *MessageQuery) Unique(unique bool) *MessageQuery
- func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery
- type MessageSelect
- func (s *MessageSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *MessageSelect) BoolX(ctx context.Context) bool
- func (s *MessageSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *MessageSelect) BoolsX(ctx context.Context) []bool
- func (s *MessageSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *MessageSelect) Float64X(ctx context.Context) float64
- func (s *MessageSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *MessageSelect) Float64sX(ctx context.Context) []float64
- func (s *MessageSelect) Int(ctx context.Context) (_ int, err error)
- func (s *MessageSelect) IntX(ctx context.Context) int
- func (s *MessageSelect) Ints(ctx context.Context) ([]int, error)
- func (s *MessageSelect) IntsX(ctx context.Context) []int
- func (ms *MessageSelect) Scan(ctx context.Context, v interface{}) error
- func (s *MessageSelect) ScanX(ctx context.Context, v interface{})
- func (s *MessageSelect) String(ctx context.Context) (_ string, err error)
- func (s *MessageSelect) StringX(ctx context.Context) string
- func (s *MessageSelect) Strings(ctx context.Context) ([]string, error)
- func (s *MessageSelect) StringsX(ctx context.Context) []string
- type MessageUpdate
- func (mu *MessageUpdate) AddDestinationPort(i int) *MessageUpdate
- func (mu *MessageUpdate) AddOpcode(i int) *MessageUpdate
- func (mu *MessageUpdate) AddSegmentType(i int) *MessageUpdate
- func (mu *MessageUpdate) AddServer(i int) *MessageUpdate
- func (mu *MessageUpdate) AddSize(u int32) *MessageUpdate
- func (mu *MessageUpdate) AddSourceActor(u int32) *MessageUpdate
- func (mu *MessageUpdate) AddSourcePort(i int) *MessageUpdate
- func (mu *MessageUpdate) AddTargetActor(u int32) *MessageUpdate
- func (mu *MessageUpdate) AddTimestampRaw(u int32) *MessageUpdate
- func (mu *MessageUpdate) AddVersion(i int) *MessageUpdate
- func (mu *MessageUpdate) ClearData() *MessageUpdate
- func (mu *MessageUpdate) ClearOpcode() *MessageUpdate
- func (mu *MessageUpdate) ClearServer() *MessageUpdate
- func (mu *MessageUpdate) ClearTimestampRaw() *MessageUpdate
- func (mu *MessageUpdate) Exec(ctx context.Context) error
- func (mu *MessageUpdate) ExecX(ctx context.Context)
- func (mu *MessageUpdate) Mutation() *MessageMutation
- func (mu *MessageUpdate) Save(ctx context.Context) (int, error)
- func (mu *MessageUpdate) SaveX(ctx context.Context) int
- func (mu *MessageUpdate) SetData(b []byte) *MessageUpdate
- func (mu *MessageUpdate) SetDestinationAddress(s string) *MessageUpdate
- func (mu *MessageUpdate) SetDestinationPort(i int) *MessageUpdate
- func (mu *MessageUpdate) SetNillableOpcode(i *int) *MessageUpdate
- func (mu *MessageUpdate) SetNillableServer(i *int) *MessageUpdate
- func (mu *MessageUpdate) SetNillableTimestampRaw(u *uint32) *MessageUpdate
- func (mu *MessageUpdate) SetOpcode(i int) *MessageUpdate
- func (mu *MessageUpdate) SetSegmentType(i int) *MessageUpdate
- func (mu *MessageUpdate) SetServer(i int) *MessageUpdate
- func (mu *MessageUpdate) SetSize(u uint32) *MessageUpdate
- func (mu *MessageUpdate) SetSourceActor(u uint32) *MessageUpdate
- func (mu *MessageUpdate) SetSourceAddress(s string) *MessageUpdate
- func (mu *MessageUpdate) SetSourcePort(i int) *MessageUpdate
- func (mu *MessageUpdate) SetTargetActor(u uint32) *MessageUpdate
- func (mu *MessageUpdate) SetTimestamp(t time.Time) *MessageUpdate
- func (mu *MessageUpdate) SetTimestampRaw(u uint32) *MessageUpdate
- func (mu *MessageUpdate) SetVersion(i int) *MessageUpdate
- func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate
- type MessageUpdateOne
- func (muo *MessageUpdateOne) AddDestinationPort(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddOpcode(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddSegmentType(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddServer(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddSize(u int32) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddSourceActor(u int32) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddSourcePort(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddTargetActor(u int32) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddTimestampRaw(u int32) *MessageUpdateOne
- func (muo *MessageUpdateOne) AddVersion(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) ClearData() *MessageUpdateOne
- func (muo *MessageUpdateOne) ClearOpcode() *MessageUpdateOne
- func (muo *MessageUpdateOne) ClearServer() *MessageUpdateOne
- func (muo *MessageUpdateOne) ClearTimestampRaw() *MessageUpdateOne
- func (muo *MessageUpdateOne) Exec(ctx context.Context) error
- func (muo *MessageUpdateOne) ExecX(ctx context.Context)
- func (muo *MessageUpdateOne) Mutation() *MessageMutation
- func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)
- func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message
- func (muo *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetData(b []byte) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetDestinationAddress(s string) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetDestinationPort(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetNillableOpcode(i *int) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetNillableServer(i *int) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetNillableTimestampRaw(u *uint32) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetOpcode(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetSegmentType(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetServer(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetSize(u uint32) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetSourceActor(u uint32) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetSourceAddress(s string) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetSourcePort(i int) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetTargetActor(u uint32) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetTimestamp(t time.Time) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetTimestampRaw(u uint32) *MessageUpdateOne
- func (muo *MessageUpdateOne) SetVersion(i int) *MessageUpdateOne
- type Messages
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeLogEvent = "LogEvent" TypeMessage = "Message" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // LogEvent is the client for interacting with the LogEvent builders. LogEvent *LogEventClient // Message is the client for interacting with the Message builders. Message *MessageClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.
func (*Client) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). LogEvent. Query(). Count(ctx)
type CommitFunc ¶
The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.
type CommitHook ¶
CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:
hook := func(next ent.Committer) ent.Committer { return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Commit(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type ConstraintError ¶
type ConstraintError struct {
// contains filtered or unexported fields
}
ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.
func (ConstraintError) Error ¶
func (e ConstraintError) Error() string
Error implements the error interface.
func (*ConstraintError) Unwrap ¶
func (e *ConstraintError) Unwrap() error
Unwrap implements the errors.Wrapper interface.
type LogEvent ¶ added in v0.2.0
type LogEvent struct { // ID of the ent. ID int `json:"id,omitempty"` // Timestamp holds the value of the "timestamp" field. Timestamp time.Time `json:"timestamp,omitempty"` // Level holds the value of the "level" field. Level int `json:"level,omitempty"` // Message holds the value of the "message" field. Message string `json:"message,omitempty"` // contains filtered or unexported fields }
LogEvent is the model entity for the LogEvent schema.
func (*LogEvent) Unwrap ¶ added in v0.2.0
Unwrap unwraps the LogEvent entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*LogEvent) Update ¶ added in v0.2.0
func (le *LogEvent) Update() *LogEventUpdateOne
Update returns a builder for updating this LogEvent. Note that you need to call LogEvent.Unwrap() before calling this method if this LogEvent was returned from a transaction, and the transaction was committed or rolled back.
type LogEventClient ¶ added in v0.2.0
type LogEventClient struct {
// contains filtered or unexported fields
}
LogEventClient is a client for the LogEvent schema.
func NewLogEventClient ¶ added in v0.2.0
func NewLogEventClient(c config) *LogEventClient
NewLogEventClient returns a client for the LogEvent from the given config.
func (*LogEventClient) Create ¶ added in v0.2.0
func (c *LogEventClient) Create() *LogEventCreate
Create returns a builder for creating a LogEvent entity.
func (*LogEventClient) CreateBulk ¶ added in v0.2.0
func (c *LogEventClient) CreateBulk(builders ...*LogEventCreate) *LogEventCreateBulk
CreateBulk returns a builder for creating a bulk of LogEvent entities.
func (*LogEventClient) Delete ¶ added in v0.2.0
func (c *LogEventClient) Delete() *LogEventDelete
Delete returns a delete builder for LogEvent.
func (*LogEventClient) DeleteOne ¶ added in v0.2.0
func (c *LogEventClient) DeleteOne(le *LogEvent) *LogEventDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*LogEventClient) DeleteOneID ¶ added in v0.2.0
func (c *LogEventClient) DeleteOneID(id int) *LogEventDeleteOne
DeleteOne returns a builder for deleting the given entity by its id.
func (*LogEventClient) GetX ¶ added in v0.2.0
func (c *LogEventClient) GetX(ctx context.Context, id int) *LogEvent
GetX is like Get, but panics if an error occurs.
func (*LogEventClient) Hooks ¶ added in v0.2.0
func (c *LogEventClient) Hooks() []Hook
Hooks returns the client hooks.
func (*LogEventClient) Query ¶ added in v0.2.0
func (c *LogEventClient) Query() *LogEventQuery
Query returns a query builder for LogEvent.
func (*LogEventClient) Update ¶ added in v0.2.0
func (c *LogEventClient) Update() *LogEventUpdate
Update returns an update builder for LogEvent.
func (*LogEventClient) UpdateOne ¶ added in v0.2.0
func (c *LogEventClient) UpdateOne(le *LogEvent) *LogEventUpdateOne
UpdateOne returns an update builder for the given entity.
func (*LogEventClient) UpdateOneID ¶ added in v0.2.0
func (c *LogEventClient) UpdateOneID(id int) *LogEventUpdateOne
UpdateOneID returns an update builder for the given id.
func (*LogEventClient) Use ¶ added in v0.2.0
func (c *LogEventClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `logevent.Hooks(f(g(h())))`.
type LogEventCreate ¶ added in v0.2.0
type LogEventCreate struct {
// contains filtered or unexported fields
}
LogEventCreate is the builder for creating a LogEvent entity.
func (*LogEventCreate) Exec ¶ added in v0.2.0
func (lec *LogEventCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*LogEventCreate) ExecX ¶ added in v0.2.0
func (lec *LogEventCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LogEventCreate) Mutation ¶ added in v0.2.0
func (lec *LogEventCreate) Mutation() *LogEventMutation
Mutation returns the LogEventMutation object of the builder.
func (*LogEventCreate) Save ¶ added in v0.2.0
func (lec *LogEventCreate) Save(ctx context.Context) (*LogEvent, error)
Save creates the LogEvent in the database.
func (*LogEventCreate) SaveX ¶ added in v0.2.0
func (lec *LogEventCreate) SaveX(ctx context.Context) *LogEvent
SaveX calls Save and panics if Save returns an error.
func (*LogEventCreate) SetLevel ¶ added in v0.2.0
func (lec *LogEventCreate) SetLevel(i int) *LogEventCreate
SetLevel sets the "level" field.
func (*LogEventCreate) SetMessage ¶ added in v0.2.0
func (lec *LogEventCreate) SetMessage(s string) *LogEventCreate
SetMessage sets the "message" field.
func (*LogEventCreate) SetTimestamp ¶ added in v0.2.0
func (lec *LogEventCreate) SetTimestamp(t time.Time) *LogEventCreate
SetTimestamp sets the "timestamp" field.
type LogEventCreateBulk ¶ added in v0.2.0
type LogEventCreateBulk struct {
// contains filtered or unexported fields
}
LogEventCreateBulk is the builder for creating many LogEvent entities in bulk.
func (*LogEventCreateBulk) Exec ¶ added in v0.2.0
func (lecb *LogEventCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*LogEventCreateBulk) ExecX ¶ added in v0.2.0
func (lecb *LogEventCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type LogEventDelete ¶ added in v0.2.0
type LogEventDelete struct {
// contains filtered or unexported fields
}
LogEventDelete is the builder for deleting a LogEvent entity.
func (*LogEventDelete) Exec ¶ added in v0.2.0
func (led *LogEventDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*LogEventDelete) ExecX ¶ added in v0.2.0
func (led *LogEventDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*LogEventDelete) Where ¶ added in v0.2.0
func (led *LogEventDelete) Where(ps ...predicate.LogEvent) *LogEventDelete
Where appends a list predicates to the LogEventDelete builder.
type LogEventDeleteOne ¶ added in v0.2.0
type LogEventDeleteOne struct {
// contains filtered or unexported fields
}
LogEventDeleteOne is the builder for deleting a single LogEvent entity.
func (*LogEventDeleteOne) Exec ¶ added in v0.2.0
func (ledo *LogEventDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*LogEventDeleteOne) ExecX ¶ added in v0.2.0
func (ledo *LogEventDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type LogEventGroupBy ¶ added in v0.2.0
type LogEventGroupBy struct {
// contains filtered or unexported fields
}
LogEventGroupBy is the group-by builder for LogEvent entities.
func (*LogEventGroupBy) Aggregate ¶ added in v0.2.0
func (legb *LogEventGroupBy) Aggregate(fns ...AggregateFunc) *LogEventGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*LogEventGroupBy) Bool ¶ added in v0.2.0
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LogEventGroupBy) Bools ¶ added in v0.2.0
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LogEventGroupBy) BoolsX ¶ added in v0.2.0
BoolsX is like Bools, but panics if an error occurs.
func (*LogEventGroupBy) Float64 ¶ added in v0.2.0
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LogEventGroupBy) Float64X ¶ added in v0.2.0
Float64X is like Float64, but panics if an error occurs.
func (*LogEventGroupBy) Float64s ¶ added in v0.2.0
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LogEventGroupBy) Float64sX ¶ added in v0.2.0
Float64sX is like Float64s, but panics if an error occurs.
func (*LogEventGroupBy) Int ¶ added in v0.2.0
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LogEventGroupBy) Ints ¶ added in v0.2.0
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LogEventGroupBy) Scan ¶ added in v0.2.0
func (legb *LogEventGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*LogEventGroupBy) String ¶ added in v0.2.0
String returns a single string from a selector. It is only allowed when selecting one field.
func (*LogEventGroupBy) StringX ¶ added in v0.2.0
StringX is like String, but panics if an error occurs.
type LogEventMutation ¶ added in v0.2.0
type LogEventMutation struct {
// contains filtered or unexported fields
}
LogEventMutation represents an operation that mutates the LogEvent nodes in the graph.
func (*LogEventMutation) AddField ¶ added in v0.2.0
func (m *LogEventMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*LogEventMutation) AddLevel ¶ added in v0.2.0
func (m *LogEventMutation) AddLevel(i int)
AddLevel adds i to the "level" field.
func (*LogEventMutation) AddedEdges ¶ added in v0.2.0
func (m *LogEventMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*LogEventMutation) AddedField ¶ added in v0.2.0
func (m *LogEventMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*LogEventMutation) AddedFields ¶ added in v0.2.0
func (m *LogEventMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*LogEventMutation) AddedIDs ¶ added in v0.2.0
func (m *LogEventMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*LogEventMutation) AddedLevel ¶ added in v0.2.0
func (m *LogEventMutation) AddedLevel() (r int, exists bool)
AddedLevel returns the value that was added to the "level" field in this mutation.
func (*LogEventMutation) ClearEdge ¶ added in v0.2.0
func (m *LogEventMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*LogEventMutation) ClearField ¶ added in v0.2.0
func (m *LogEventMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*LogEventMutation) ClearedEdges ¶ added in v0.2.0
func (m *LogEventMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*LogEventMutation) ClearedFields ¶ added in v0.2.0
func (m *LogEventMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (LogEventMutation) Client ¶ added in v0.2.0
func (m LogEventMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*LogEventMutation) EdgeCleared ¶ added in v0.2.0
func (m *LogEventMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*LogEventMutation) Field ¶ added in v0.2.0
func (m *LogEventMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*LogEventMutation) FieldCleared ¶ added in v0.2.0
func (m *LogEventMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*LogEventMutation) Fields ¶ added in v0.2.0
func (m *LogEventMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*LogEventMutation) ID ¶ added in v0.2.0
func (m *LogEventMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*LogEventMutation) IDs ¶ added in v0.2.0
func (m *LogEventMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*LogEventMutation) Level ¶ added in v0.2.0
func (m *LogEventMutation) Level() (r int, exists bool)
Level returns the value of the "level" field in the mutation.
func (*LogEventMutation) Message ¶ added in v0.2.0
func (m *LogEventMutation) Message() (r string, exists bool)
Message returns the value of the "message" field in the mutation.
func (*LogEventMutation) OldField ¶ added in v0.2.0
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*LogEventMutation) OldLevel ¶ added in v0.2.0
func (m *LogEventMutation) OldLevel(ctx context.Context) (v int, err error)
OldLevel returns the old "level" field's value of the LogEvent entity. If the LogEvent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*LogEventMutation) OldMessage ¶ added in v0.2.0
func (m *LogEventMutation) OldMessage(ctx context.Context) (v string, err error)
OldMessage returns the old "message" field's value of the LogEvent entity. If the LogEvent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*LogEventMutation) OldTimestamp ¶ added in v0.2.0
OldTimestamp returns the old "timestamp" field's value of the LogEvent entity. If the LogEvent object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*LogEventMutation) Op ¶ added in v0.2.0
func (m *LogEventMutation) Op() Op
Op returns the operation name.
func (*LogEventMutation) RemovedEdges ¶ added in v0.2.0
func (m *LogEventMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*LogEventMutation) RemovedIDs ¶ added in v0.2.0
func (m *LogEventMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*LogEventMutation) ResetEdge ¶ added in v0.2.0
func (m *LogEventMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*LogEventMutation) ResetField ¶ added in v0.2.0
func (m *LogEventMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*LogEventMutation) ResetLevel ¶ added in v0.2.0
func (m *LogEventMutation) ResetLevel()
ResetLevel resets all changes to the "level" field.
func (*LogEventMutation) ResetMessage ¶ added in v0.2.0
func (m *LogEventMutation) ResetMessage()
ResetMessage resets all changes to the "message" field.
func (*LogEventMutation) ResetTimestamp ¶ added in v0.2.0
func (m *LogEventMutation) ResetTimestamp()
ResetTimestamp resets all changes to the "timestamp" field.
func (*LogEventMutation) SetField ¶ added in v0.2.0
func (m *LogEventMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*LogEventMutation) SetLevel ¶ added in v0.2.0
func (m *LogEventMutation) SetLevel(i int)
SetLevel sets the "level" field.
func (*LogEventMutation) SetMessage ¶ added in v0.2.0
func (m *LogEventMutation) SetMessage(s string)
SetMessage sets the "message" field.
func (*LogEventMutation) SetTimestamp ¶ added in v0.2.0
func (m *LogEventMutation) SetTimestamp(t time.Time)
SetTimestamp sets the "timestamp" field.
func (*LogEventMutation) Timestamp ¶ added in v0.2.0
func (m *LogEventMutation) Timestamp() (r time.Time, exists bool)
Timestamp returns the value of the "timestamp" field in the mutation.
func (LogEventMutation) Tx ¶ added in v0.2.0
func (m LogEventMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*LogEventMutation) Type ¶ added in v0.2.0
func (m *LogEventMutation) Type() string
Type returns the node type of this mutation (LogEvent).
func (*LogEventMutation) Where ¶ added in v0.2.0
func (m *LogEventMutation) Where(ps ...predicate.LogEvent)
Where appends a list predicates to the LogEventMutation builder.
type LogEventQuery ¶ added in v0.2.0
type LogEventQuery struct {
// contains filtered or unexported fields
}
LogEventQuery is the builder for querying LogEvent entities.
func (*LogEventQuery) All ¶ added in v0.2.0
func (leq *LogEventQuery) All(ctx context.Context) ([]*LogEvent, error)
All executes the query and returns a list of LogEvents.
func (*LogEventQuery) AllX ¶ added in v0.2.0
func (leq *LogEventQuery) AllX(ctx context.Context) []*LogEvent
AllX is like All, but panics if an error occurs.
func (*LogEventQuery) Clone ¶ added in v0.2.0
func (leq *LogEventQuery) Clone() *LogEventQuery
Clone returns a duplicate of the LogEventQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*LogEventQuery) Count ¶ added in v0.2.0
func (leq *LogEventQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*LogEventQuery) CountX ¶ added in v0.2.0
func (leq *LogEventQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*LogEventQuery) Exist ¶ added in v0.2.0
func (leq *LogEventQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*LogEventQuery) ExistX ¶ added in v0.2.0
func (leq *LogEventQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*LogEventQuery) First ¶ added in v0.2.0
func (leq *LogEventQuery) First(ctx context.Context) (*LogEvent, error)
First returns the first LogEvent entity from the query. Returns a *NotFoundError when no LogEvent was found.
func (*LogEventQuery) FirstID ¶ added in v0.2.0
func (leq *LogEventQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first LogEvent ID from the query. Returns a *NotFoundError when no LogEvent ID was found.
func (*LogEventQuery) FirstIDX ¶ added in v0.2.0
func (leq *LogEventQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*LogEventQuery) FirstX ¶ added in v0.2.0
func (leq *LogEventQuery) FirstX(ctx context.Context) *LogEvent
FirstX is like First, but panics if an error occurs.
func (*LogEventQuery) GroupBy ¶ added in v0.2.0
func (leq *LogEventQuery) GroupBy(field string, fields ...string) *LogEventGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Timestamp time.Time `json:"timestamp,omitempty"` Count int `json:"count,omitempty"` } client.LogEvent.Query(). GroupBy(logevent.FieldTimestamp). Aggregate(ent.Count()). Scan(ctx, &v)
func (*LogEventQuery) IDs ¶ added in v0.2.0
func (leq *LogEventQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of LogEvent IDs.
func (*LogEventQuery) IDsX ¶ added in v0.2.0
func (leq *LogEventQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*LogEventQuery) Limit ¶ added in v0.2.0
func (leq *LogEventQuery) Limit(limit int) *LogEventQuery
Limit adds a limit step to the query.
func (*LogEventQuery) Offset ¶ added in v0.2.0
func (leq *LogEventQuery) Offset(offset int) *LogEventQuery
Offset adds an offset step to the query.
func (*LogEventQuery) Only ¶ added in v0.2.0
func (leq *LogEventQuery) Only(ctx context.Context) (*LogEvent, error)
Only returns a single LogEvent entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one LogEvent entity is found. Returns a *NotFoundError when no LogEvent entities are found.
func (*LogEventQuery) OnlyID ¶ added in v0.2.0
func (leq *LogEventQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only LogEvent ID in the query. Returns a *NotSingularError when more than one LogEvent ID is found. Returns a *NotFoundError when no entities are found.
func (*LogEventQuery) OnlyIDX ¶ added in v0.2.0
func (leq *LogEventQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*LogEventQuery) OnlyX ¶ added in v0.2.0
func (leq *LogEventQuery) OnlyX(ctx context.Context) *LogEvent
OnlyX is like Only, but panics if an error occurs.
func (*LogEventQuery) Order ¶ added in v0.2.0
func (leq *LogEventQuery) Order(o ...OrderFunc) *LogEventQuery
Order adds an order step to the query.
func (*LogEventQuery) Select ¶ added in v0.2.0
func (leq *LogEventQuery) Select(fields ...string) *LogEventSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Timestamp time.Time `json:"timestamp,omitempty"` } client.LogEvent.Query(). Select(logevent.FieldTimestamp). Scan(ctx, &v)
func (*LogEventQuery) Unique ¶ added in v0.2.0
func (leq *LogEventQuery) Unique(unique bool) *LogEventQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*LogEventQuery) Where ¶ added in v0.2.0
func (leq *LogEventQuery) Where(ps ...predicate.LogEvent) *LogEventQuery
Where adds a new predicate for the LogEventQuery builder.
type LogEventSelect ¶ added in v0.2.0
type LogEventSelect struct { *LogEventQuery // contains filtered or unexported fields }
LogEventSelect is the builder for selecting fields of LogEvent entities.
func (*LogEventSelect) Bool ¶ added in v0.2.0
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*LogEventSelect) Bools ¶ added in v0.2.0
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*LogEventSelect) BoolsX ¶ added in v0.2.0
BoolsX is like Bools, but panics if an error occurs.
func (*LogEventSelect) Float64 ¶ added in v0.2.0
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*LogEventSelect) Float64X ¶ added in v0.2.0
Float64X is like Float64, but panics if an error occurs.
func (*LogEventSelect) Float64s ¶ added in v0.2.0
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*LogEventSelect) Float64sX ¶ added in v0.2.0
Float64sX is like Float64s, but panics if an error occurs.
func (*LogEventSelect) Int ¶ added in v0.2.0
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*LogEventSelect) Ints ¶ added in v0.2.0
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*LogEventSelect) Scan ¶ added in v0.2.0
func (les *LogEventSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*LogEventSelect) String ¶ added in v0.2.0
String returns a single string from a selector. It is only allowed when selecting one field.
func (*LogEventSelect) StringX ¶ added in v0.2.0
StringX is like String, but panics if an error occurs.
type LogEventUpdate ¶ added in v0.2.0
type LogEventUpdate struct {
// contains filtered or unexported fields
}
LogEventUpdate is the builder for updating LogEvent entities.
func (*LogEventUpdate) AddLevel ¶ added in v0.2.0
func (leu *LogEventUpdate) AddLevel(i int) *LogEventUpdate
AddLevel adds i to the "level" field.
func (*LogEventUpdate) Exec ¶ added in v0.2.0
func (leu *LogEventUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*LogEventUpdate) ExecX ¶ added in v0.2.0
func (leu *LogEventUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LogEventUpdate) Mutation ¶ added in v0.2.0
func (leu *LogEventUpdate) Mutation() *LogEventMutation
Mutation returns the LogEventMutation object of the builder.
func (*LogEventUpdate) Save ¶ added in v0.2.0
func (leu *LogEventUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*LogEventUpdate) SaveX ¶ added in v0.2.0
func (leu *LogEventUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*LogEventUpdate) SetLevel ¶ added in v0.2.0
func (leu *LogEventUpdate) SetLevel(i int) *LogEventUpdate
SetLevel sets the "level" field.
func (*LogEventUpdate) SetMessage ¶ added in v0.2.0
func (leu *LogEventUpdate) SetMessage(s string) *LogEventUpdate
SetMessage sets the "message" field.
func (*LogEventUpdate) SetTimestamp ¶ added in v0.2.0
func (leu *LogEventUpdate) SetTimestamp(t time.Time) *LogEventUpdate
SetTimestamp sets the "timestamp" field.
func (*LogEventUpdate) Where ¶ added in v0.2.0
func (leu *LogEventUpdate) Where(ps ...predicate.LogEvent) *LogEventUpdate
Where appends a list predicates to the LogEventUpdate builder.
type LogEventUpdateOne ¶ added in v0.2.0
type LogEventUpdateOne struct {
// contains filtered or unexported fields
}
LogEventUpdateOne is the builder for updating a single LogEvent entity.
func (*LogEventUpdateOne) AddLevel ¶ added in v0.2.0
func (leuo *LogEventUpdateOne) AddLevel(i int) *LogEventUpdateOne
AddLevel adds i to the "level" field.
func (*LogEventUpdateOne) Exec ¶ added in v0.2.0
func (leuo *LogEventUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*LogEventUpdateOne) ExecX ¶ added in v0.2.0
func (leuo *LogEventUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*LogEventUpdateOne) Mutation ¶ added in v0.2.0
func (leuo *LogEventUpdateOne) Mutation() *LogEventMutation
Mutation returns the LogEventMutation object of the builder.
func (*LogEventUpdateOne) Save ¶ added in v0.2.0
func (leuo *LogEventUpdateOne) Save(ctx context.Context) (*LogEvent, error)
Save executes the query and returns the updated LogEvent entity.
func (*LogEventUpdateOne) SaveX ¶ added in v0.2.0
func (leuo *LogEventUpdateOne) SaveX(ctx context.Context) *LogEvent
SaveX is like Save, but panics if an error occurs.
func (*LogEventUpdateOne) Select ¶ added in v0.2.0
func (leuo *LogEventUpdateOne) Select(field string, fields ...string) *LogEventUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*LogEventUpdateOne) SetLevel ¶ added in v0.2.0
func (leuo *LogEventUpdateOne) SetLevel(i int) *LogEventUpdateOne
SetLevel sets the "level" field.
func (*LogEventUpdateOne) SetMessage ¶ added in v0.2.0
func (leuo *LogEventUpdateOne) SetMessage(s string) *LogEventUpdateOne
SetMessage sets the "message" field.
func (*LogEventUpdateOne) SetTimestamp ¶ added in v0.2.0
func (leuo *LogEventUpdateOne) SetTimestamp(t time.Time) *LogEventUpdateOne
SetTimestamp sets the "timestamp" field.
type LogEvents ¶ added in v0.2.0
type LogEvents []*LogEvent
LogEvents is a parsable slice of LogEvent.
type Message ¶
type Message struct { // ID of the ent. ID int `json:"id,omitempty"` // Timestamp holds the value of the "timestamp" field. Timestamp time.Time `json:"timestamp,omitempty"` // Version holds the value of the "version" field. Version int `json:"version,omitempty"` // SourceAddress holds the value of the "source_address" field. SourceAddress string `json:"source_address,omitempty"` // SourcePort holds the value of the "source_port" field. SourcePort int `json:"source_port,omitempty"` // DestinationAddress holds the value of the "destination_address" field. DestinationAddress string `json:"destination_address,omitempty"` // DestinationPort holds the value of the "destination_port" field. DestinationPort int `json:"destination_port,omitempty"` // Size holds the value of the "size" field. Size uint32 `json:"size,omitempty"` // SourceActor holds the value of the "source_actor" field. SourceActor uint32 `json:"source_actor,omitempty"` // TargetActor holds the value of the "target_actor" field. TargetActor uint32 `json:"target_actor,omitempty"` // SegmentType holds the value of the "segment_type" field. SegmentType int `json:"segment_type,omitempty"` // Opcode holds the value of the "opcode" field. Opcode *int `json:"opcode,omitempty"` // Server holds the value of the "server" field. Server *int `json:"server,omitempty"` // TimestampRaw holds the value of the "timestamp_raw" field. TimestampRaw *uint32 `json:"timestamp_raw,omitempty"` // Data holds the value of the "data" field. Data *[]byte `json:"data,omitempty"` // contains filtered or unexported fields }
Message is the model entity for the Message schema.
func (*Message) Unwrap ¶
Unwrap unwraps the Message entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.
func (*Message) Update ¶
func (m *Message) Update() *MessageUpdateOne
Update returns a builder for updating this Message. Note that you need to call Message.Unwrap() before calling this method if this Message was returned from a transaction, and the transaction was committed or rolled back.
type MessageClient ¶
type MessageClient struct {
// contains filtered or unexported fields
}
MessageClient is a client for the Message schema.
func NewMessageClient ¶
func NewMessageClient(c config) *MessageClient
NewMessageClient returns a client for the Message from the given config.
func (*MessageClient) Create ¶
func (c *MessageClient) Create() *MessageCreate
Create returns a builder for creating a Message entity.
func (*MessageClient) CreateBulk ¶
func (c *MessageClient) CreateBulk(builders ...*MessageCreate) *MessageCreateBulk
CreateBulk returns a builder for creating a bulk of Message entities.
func (*MessageClient) Delete ¶
func (c *MessageClient) Delete() *MessageDelete
Delete returns a delete builder for Message.
func (*MessageClient) DeleteOne ¶
func (c *MessageClient) DeleteOne(m *Message) *MessageDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*MessageClient) DeleteOneID ¶
func (c *MessageClient) DeleteOneID(id int) *MessageDeleteOne
DeleteOne returns a builder for deleting the given entity by its id.
func (*MessageClient) GetX ¶
func (c *MessageClient) GetX(ctx context.Context, id int) *Message
GetX is like Get, but panics if an error occurs.
func (*MessageClient) Hooks ¶
func (c *MessageClient) Hooks() []Hook
Hooks returns the client hooks.
func (*MessageClient) Query ¶
func (c *MessageClient) Query() *MessageQuery
Query returns a query builder for Message.
func (*MessageClient) Update ¶
func (c *MessageClient) Update() *MessageUpdate
Update returns an update builder for Message.
func (*MessageClient) UpdateOne ¶
func (c *MessageClient) UpdateOne(m *Message) *MessageUpdateOne
UpdateOne returns an update builder for the given entity.
func (*MessageClient) UpdateOneID ¶
func (c *MessageClient) UpdateOneID(id int) *MessageUpdateOne
UpdateOneID returns an update builder for the given id.
func (*MessageClient) Use ¶
func (c *MessageClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `message.Hooks(f(g(h())))`.
type MessageCreate ¶
type MessageCreate struct {
// contains filtered or unexported fields
}
MessageCreate is the builder for creating a Message entity.
func (*MessageCreate) Exec ¶
func (mc *MessageCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*MessageCreate) ExecX ¶
func (mc *MessageCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MessageCreate) Mutation ¶
func (mc *MessageCreate) Mutation() *MessageMutation
Mutation returns the MessageMutation object of the builder.
func (*MessageCreate) Save ¶
func (mc *MessageCreate) Save(ctx context.Context) (*Message, error)
Save creates the Message in the database.
func (*MessageCreate) SaveX ¶
func (mc *MessageCreate) SaveX(ctx context.Context) *Message
SaveX calls Save and panics if Save returns an error.
func (*MessageCreate) SetData ¶
func (mc *MessageCreate) SetData(b []byte) *MessageCreate
SetData sets the "data" field.
func (*MessageCreate) SetDestinationAddress ¶
func (mc *MessageCreate) SetDestinationAddress(s string) *MessageCreate
SetDestinationAddress sets the "destination_address" field.
func (*MessageCreate) SetDestinationPort ¶
func (mc *MessageCreate) SetDestinationPort(i int) *MessageCreate
SetDestinationPort sets the "destination_port" field.
func (*MessageCreate) SetNillableOpcode ¶ added in v0.1.1
func (mc *MessageCreate) SetNillableOpcode(i *int) *MessageCreate
SetNillableOpcode sets the "opcode" field if the given value is not nil.
func (*MessageCreate) SetNillableServer ¶ added in v0.3.0
func (mc *MessageCreate) SetNillableServer(i *int) *MessageCreate
SetNillableServer sets the "server" field if the given value is not nil.
func (*MessageCreate) SetNillableTimestampRaw ¶ added in v0.3.0
func (mc *MessageCreate) SetNillableTimestampRaw(u *uint32) *MessageCreate
SetNillableTimestampRaw sets the "timestamp_raw" field if the given value is not nil.
func (*MessageCreate) SetOpcode ¶ added in v0.1.1
func (mc *MessageCreate) SetOpcode(i int) *MessageCreate
SetOpcode sets the "opcode" field.
func (*MessageCreate) SetSegmentType ¶ added in v0.3.0
func (mc *MessageCreate) SetSegmentType(i int) *MessageCreate
SetSegmentType sets the "segment_type" field.
func (*MessageCreate) SetServer ¶ added in v0.3.0
func (mc *MessageCreate) SetServer(i int) *MessageCreate
SetServer sets the "server" field.
func (*MessageCreate) SetSize ¶ added in v0.3.0
func (mc *MessageCreate) SetSize(u uint32) *MessageCreate
SetSize sets the "size" field.
func (*MessageCreate) SetSourceActor ¶ added in v0.3.0
func (mc *MessageCreate) SetSourceActor(u uint32) *MessageCreate
SetSourceActor sets the "source_actor" field.
func (*MessageCreate) SetSourceAddress ¶
func (mc *MessageCreate) SetSourceAddress(s string) *MessageCreate
SetSourceAddress sets the "source_address" field.
func (*MessageCreate) SetSourcePort ¶
func (mc *MessageCreate) SetSourcePort(i int) *MessageCreate
SetSourcePort sets the "source_port" field.
func (*MessageCreate) SetTargetActor ¶ added in v0.3.0
func (mc *MessageCreate) SetTargetActor(u uint32) *MessageCreate
SetTargetActor sets the "target_actor" field.
func (*MessageCreate) SetTimestamp ¶
func (mc *MessageCreate) SetTimestamp(t time.Time) *MessageCreate
SetTimestamp sets the "timestamp" field.
func (*MessageCreate) SetTimestampRaw ¶ added in v0.3.0
func (mc *MessageCreate) SetTimestampRaw(u uint32) *MessageCreate
SetTimestampRaw sets the "timestamp_raw" field.
func (*MessageCreate) SetVersion ¶
func (mc *MessageCreate) SetVersion(i int) *MessageCreate
SetVersion sets the "version" field.
type MessageCreateBulk ¶
type MessageCreateBulk struct {
// contains filtered or unexported fields
}
MessageCreateBulk is the builder for creating many Message entities in bulk.
func (*MessageCreateBulk) Exec ¶
func (mcb *MessageCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*MessageCreateBulk) ExecX ¶
func (mcb *MessageCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MessageDelete ¶
type MessageDelete struct {
// contains filtered or unexported fields
}
MessageDelete is the builder for deleting a Message entity.
func (*MessageDelete) Exec ¶
func (md *MessageDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*MessageDelete) ExecX ¶
func (md *MessageDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*MessageDelete) Where ¶
func (md *MessageDelete) Where(ps ...predicate.Message) *MessageDelete
Where appends a list predicates to the MessageDelete builder.
type MessageDeleteOne ¶
type MessageDeleteOne struct {
// contains filtered or unexported fields
}
MessageDeleteOne is the builder for deleting a single Message entity.
func (*MessageDeleteOne) Exec ¶
func (mdo *MessageDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*MessageDeleteOne) ExecX ¶
func (mdo *MessageDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type MessageGroupBy ¶
type MessageGroupBy struct {
// contains filtered or unexported fields
}
MessageGroupBy is the group-by builder for Message entities.
func (*MessageGroupBy) Aggregate ¶
func (mgb *MessageGroupBy) Aggregate(fns ...AggregateFunc) *MessageGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*MessageGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MessageGroupBy) Scan ¶
func (mgb *MessageGroupBy) Scan(ctx context.Context, v interface{}) error
Scan applies the group-by query and scans the result into the given value.
func (*MessageGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MessageMutation ¶
type MessageMutation struct {
// contains filtered or unexported fields
}
MessageMutation represents an operation that mutates the Message nodes in the graph.
func (*MessageMutation) AddDestinationPort ¶
func (m *MessageMutation) AddDestinationPort(i int)
AddDestinationPort adds i to the "destination_port" field.
func (*MessageMutation) AddField ¶
func (m *MessageMutation) AddField(name string, value ent.Value) error
AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*MessageMutation) AddOpcode ¶ added in v0.1.1
func (m *MessageMutation) AddOpcode(i int)
AddOpcode adds i to the "opcode" field.
func (*MessageMutation) AddSegmentType ¶ added in v0.3.0
func (m *MessageMutation) AddSegmentType(i int)
AddSegmentType adds i to the "segment_type" field.
func (*MessageMutation) AddServer ¶ added in v0.3.0
func (m *MessageMutation) AddServer(i int)
AddServer adds i to the "server" field.
func (*MessageMutation) AddSize ¶ added in v0.3.0
func (m *MessageMutation) AddSize(u int32)
AddSize adds u to the "size" field.
func (*MessageMutation) AddSourceActor ¶ added in v0.3.0
func (m *MessageMutation) AddSourceActor(u int32)
AddSourceActor adds u to the "source_actor" field.
func (*MessageMutation) AddSourcePort ¶
func (m *MessageMutation) AddSourcePort(i int)
AddSourcePort adds i to the "source_port" field.
func (*MessageMutation) AddTargetActor ¶ added in v0.3.0
func (m *MessageMutation) AddTargetActor(u int32)
AddTargetActor adds u to the "target_actor" field.
func (*MessageMutation) AddTimestampRaw ¶ added in v0.3.0
func (m *MessageMutation) AddTimestampRaw(u int32)
AddTimestampRaw adds u to the "timestamp_raw" field.
func (*MessageMutation) AddVersion ¶
func (m *MessageMutation) AddVersion(i int)
AddVersion adds i to the "version" field.
func (*MessageMutation) AddedDestinationPort ¶
func (m *MessageMutation) AddedDestinationPort() (r int, exists bool)
AddedDestinationPort returns the value that was added to the "destination_port" field in this mutation.
func (*MessageMutation) AddedEdges ¶
func (m *MessageMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*MessageMutation) AddedField ¶
func (m *MessageMutation) AddedField(name string) (ent.Value, bool)
AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*MessageMutation) AddedFields ¶
func (m *MessageMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*MessageMutation) AddedIDs ¶
func (m *MessageMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*MessageMutation) AddedOpcode ¶ added in v0.1.1
func (m *MessageMutation) AddedOpcode() (r int, exists bool)
AddedOpcode returns the value that was added to the "opcode" field in this mutation.
func (*MessageMutation) AddedSegmentType ¶ added in v0.3.0
func (m *MessageMutation) AddedSegmentType() (r int, exists bool)
AddedSegmentType returns the value that was added to the "segment_type" field in this mutation.
func (*MessageMutation) AddedServer ¶ added in v0.3.0
func (m *MessageMutation) AddedServer() (r int, exists bool)
AddedServer returns the value that was added to the "server" field in this mutation.
func (*MessageMutation) AddedSize ¶ added in v0.3.0
func (m *MessageMutation) AddedSize() (r int32, exists bool)
AddedSize returns the value that was added to the "size" field in this mutation.
func (*MessageMutation) AddedSourceActor ¶ added in v0.3.0
func (m *MessageMutation) AddedSourceActor() (r int32, exists bool)
AddedSourceActor returns the value that was added to the "source_actor" field in this mutation.
func (*MessageMutation) AddedSourcePort ¶
func (m *MessageMutation) AddedSourcePort() (r int, exists bool)
AddedSourcePort returns the value that was added to the "source_port" field in this mutation.
func (*MessageMutation) AddedTargetActor ¶ added in v0.3.0
func (m *MessageMutation) AddedTargetActor() (r int32, exists bool)
AddedTargetActor returns the value that was added to the "target_actor" field in this mutation.
func (*MessageMutation) AddedTimestampRaw ¶ added in v0.3.0
func (m *MessageMutation) AddedTimestampRaw() (r int32, exists bool)
AddedTimestampRaw returns the value that was added to the "timestamp_raw" field in this mutation.
func (*MessageMutation) AddedVersion ¶
func (m *MessageMutation) AddedVersion() (r int, exists bool)
AddedVersion returns the value that was added to the "version" field in this mutation.
func (*MessageMutation) ClearData ¶ added in v0.3.0
func (m *MessageMutation) ClearData()
ClearData clears the value of the "data" field.
func (*MessageMutation) ClearEdge ¶
func (m *MessageMutation) ClearEdge(name string) error
ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.
func (*MessageMutation) ClearField ¶
func (m *MessageMutation) ClearField(name string) error
ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.
func (*MessageMutation) ClearOpcode ¶ added in v0.1.1
func (m *MessageMutation) ClearOpcode()
ClearOpcode clears the value of the "opcode" field.
func (*MessageMutation) ClearServer ¶ added in v0.3.0
func (m *MessageMutation) ClearServer()
ClearServer clears the value of the "server" field.
func (*MessageMutation) ClearTimestampRaw ¶ added in v0.3.0
func (m *MessageMutation) ClearTimestampRaw()
ClearTimestampRaw clears the value of the "timestamp_raw" field.
func (*MessageMutation) ClearedEdges ¶
func (m *MessageMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*MessageMutation) ClearedFields ¶
func (m *MessageMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (MessageMutation) Client ¶
func (m MessageMutation) Client() *Client
Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.
func (*MessageMutation) Data ¶
func (m *MessageMutation) Data() (r []byte, exists bool)
Data returns the value of the "data" field in the mutation.
func (*MessageMutation) DataCleared ¶ added in v0.3.0
func (m *MessageMutation) DataCleared() bool
DataCleared returns if the "data" field was cleared in this mutation.
func (*MessageMutation) DestinationAddress ¶
func (m *MessageMutation) DestinationAddress() (r string, exists bool)
DestinationAddress returns the value of the "destination_address" field in the mutation.
func (*MessageMutation) DestinationPort ¶
func (m *MessageMutation) DestinationPort() (r int, exists bool)
DestinationPort returns the value of the "destination_port" field in the mutation.
func (*MessageMutation) EdgeCleared ¶
func (m *MessageMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*MessageMutation) Field ¶
func (m *MessageMutation) Field(name string) (ent.Value, bool)
Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.
func (*MessageMutation) FieldCleared ¶
func (m *MessageMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*MessageMutation) Fields ¶
func (m *MessageMutation) Fields() []string
Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().
func (*MessageMutation) ID ¶
func (m *MessageMutation) ID() (id int, exists bool)
ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.
func (*MessageMutation) IDs ¶
func (m *MessageMutation) IDs(ctx context.Context) ([]int, error)
IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.
func (*MessageMutation) OldData ¶
func (m *MessageMutation) OldData(ctx context.Context) (v *[]byte, err error)
OldData returns the old "data" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldDestinationAddress ¶
func (m *MessageMutation) OldDestinationAddress(ctx context.Context) (v string, err error)
OldDestinationAddress returns the old "destination_address" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldDestinationPort ¶
func (m *MessageMutation) OldDestinationPort(ctx context.Context) (v int, err error)
OldDestinationPort returns the old "destination_port" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldField ¶
OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.
func (*MessageMutation) OldOpcode ¶ added in v0.1.1
func (m *MessageMutation) OldOpcode(ctx context.Context) (v *int, err error)
OldOpcode returns the old "opcode" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldSegmentType ¶ added in v0.3.0
func (m *MessageMutation) OldSegmentType(ctx context.Context) (v int, err error)
OldSegmentType returns the old "segment_type" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldServer ¶ added in v0.3.0
func (m *MessageMutation) OldServer(ctx context.Context) (v *int, err error)
OldServer returns the old "server" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldSize ¶ added in v0.3.0
func (m *MessageMutation) OldSize(ctx context.Context) (v uint32, err error)
OldSize returns the old "size" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldSourceActor ¶ added in v0.3.0
func (m *MessageMutation) OldSourceActor(ctx context.Context) (v uint32, err error)
OldSourceActor returns the old "source_actor" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldSourceAddress ¶
func (m *MessageMutation) OldSourceAddress(ctx context.Context) (v string, err error)
OldSourceAddress returns the old "source_address" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldSourcePort ¶
func (m *MessageMutation) OldSourcePort(ctx context.Context) (v int, err error)
OldSourcePort returns the old "source_port" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldTargetActor ¶ added in v0.3.0
func (m *MessageMutation) OldTargetActor(ctx context.Context) (v uint32, err error)
OldTargetActor returns the old "target_actor" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldTimestamp ¶
OldTimestamp returns the old "timestamp" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldTimestampRaw ¶ added in v0.3.0
func (m *MessageMutation) OldTimestampRaw(ctx context.Context) (v *uint32, err error)
OldTimestampRaw returns the old "timestamp_raw" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) OldVersion ¶
func (m *MessageMutation) OldVersion(ctx context.Context) (v int, err error)
OldVersion returns the old "version" field's value of the Message entity. If the Message object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.
func (*MessageMutation) Opcode ¶ added in v0.1.1
func (m *MessageMutation) Opcode() (r int, exists bool)
Opcode returns the value of the "opcode" field in the mutation.
func (*MessageMutation) OpcodeCleared ¶ added in v0.1.1
func (m *MessageMutation) OpcodeCleared() bool
OpcodeCleared returns if the "opcode" field was cleared in this mutation.
func (*MessageMutation) RemovedEdges ¶
func (m *MessageMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*MessageMutation) RemovedIDs ¶
func (m *MessageMutation) RemovedIDs(name string) []ent.Value
RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.
func (*MessageMutation) ResetData ¶
func (m *MessageMutation) ResetData()
ResetData resets all changes to the "data" field.
func (*MessageMutation) ResetDestinationAddress ¶
func (m *MessageMutation) ResetDestinationAddress()
ResetDestinationAddress resets all changes to the "destination_address" field.
func (*MessageMutation) ResetDestinationPort ¶
func (m *MessageMutation) ResetDestinationPort()
ResetDestinationPort resets all changes to the "destination_port" field.
func (*MessageMutation) ResetEdge ¶
func (m *MessageMutation) ResetEdge(name string) error
ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.
func (*MessageMutation) ResetField ¶
func (m *MessageMutation) ResetField(name string) error
ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.
func (*MessageMutation) ResetOpcode ¶ added in v0.1.1
func (m *MessageMutation) ResetOpcode()
ResetOpcode resets all changes to the "opcode" field.
func (*MessageMutation) ResetSegmentType ¶ added in v0.3.0
func (m *MessageMutation) ResetSegmentType()
ResetSegmentType resets all changes to the "segment_type" field.
func (*MessageMutation) ResetServer ¶ added in v0.3.0
func (m *MessageMutation) ResetServer()
ResetServer resets all changes to the "server" field.
func (*MessageMutation) ResetSize ¶ added in v0.3.0
func (m *MessageMutation) ResetSize()
ResetSize resets all changes to the "size" field.
func (*MessageMutation) ResetSourceActor ¶ added in v0.3.0
func (m *MessageMutation) ResetSourceActor()
ResetSourceActor resets all changes to the "source_actor" field.
func (*MessageMutation) ResetSourceAddress ¶
func (m *MessageMutation) ResetSourceAddress()
ResetSourceAddress resets all changes to the "source_address" field.
func (*MessageMutation) ResetSourcePort ¶
func (m *MessageMutation) ResetSourcePort()
ResetSourcePort resets all changes to the "source_port" field.
func (*MessageMutation) ResetTargetActor ¶ added in v0.3.0
func (m *MessageMutation) ResetTargetActor()
ResetTargetActor resets all changes to the "target_actor" field.
func (*MessageMutation) ResetTimestamp ¶
func (m *MessageMutation) ResetTimestamp()
ResetTimestamp resets all changes to the "timestamp" field.
func (*MessageMutation) ResetTimestampRaw ¶ added in v0.3.0
func (m *MessageMutation) ResetTimestampRaw()
ResetTimestampRaw resets all changes to the "timestamp_raw" field.
func (*MessageMutation) ResetVersion ¶
func (m *MessageMutation) ResetVersion()
ResetVersion resets all changes to the "version" field.
func (*MessageMutation) SegmentType ¶ added in v0.3.0
func (m *MessageMutation) SegmentType() (r int, exists bool)
SegmentType returns the value of the "segment_type" field in the mutation.
func (*MessageMutation) Server ¶ added in v0.3.0
func (m *MessageMutation) Server() (r int, exists bool)
Server returns the value of the "server" field in the mutation.
func (*MessageMutation) ServerCleared ¶ added in v0.3.0
func (m *MessageMutation) ServerCleared() bool
ServerCleared returns if the "server" field was cleared in this mutation.
func (*MessageMutation) SetData ¶
func (m *MessageMutation) SetData(b []byte)
SetData sets the "data" field.
func (*MessageMutation) SetDestinationAddress ¶
func (m *MessageMutation) SetDestinationAddress(s string)
SetDestinationAddress sets the "destination_address" field.
func (*MessageMutation) SetDestinationPort ¶
func (m *MessageMutation) SetDestinationPort(i int)
SetDestinationPort sets the "destination_port" field.
func (*MessageMutation) SetField ¶
func (m *MessageMutation) SetField(name string, value ent.Value) error
SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.
func (*MessageMutation) SetOpcode ¶ added in v0.1.1
func (m *MessageMutation) SetOpcode(i int)
SetOpcode sets the "opcode" field.
func (*MessageMutation) SetSegmentType ¶ added in v0.3.0
func (m *MessageMutation) SetSegmentType(i int)
SetSegmentType sets the "segment_type" field.
func (*MessageMutation) SetServer ¶ added in v0.3.0
func (m *MessageMutation) SetServer(i int)
SetServer sets the "server" field.
func (*MessageMutation) SetSize ¶ added in v0.3.0
func (m *MessageMutation) SetSize(u uint32)
SetSize sets the "size" field.
func (*MessageMutation) SetSourceActor ¶ added in v0.3.0
func (m *MessageMutation) SetSourceActor(u uint32)
SetSourceActor sets the "source_actor" field.
func (*MessageMutation) SetSourceAddress ¶
func (m *MessageMutation) SetSourceAddress(s string)
SetSourceAddress sets the "source_address" field.
func (*MessageMutation) SetSourcePort ¶
func (m *MessageMutation) SetSourcePort(i int)
SetSourcePort sets the "source_port" field.
func (*MessageMutation) SetTargetActor ¶ added in v0.3.0
func (m *MessageMutation) SetTargetActor(u uint32)
SetTargetActor sets the "target_actor" field.
func (*MessageMutation) SetTimestamp ¶
func (m *MessageMutation) SetTimestamp(t time.Time)
SetTimestamp sets the "timestamp" field.
func (*MessageMutation) SetTimestampRaw ¶ added in v0.3.0
func (m *MessageMutation) SetTimestampRaw(u uint32)
SetTimestampRaw sets the "timestamp_raw" field.
func (*MessageMutation) SetVersion ¶
func (m *MessageMutation) SetVersion(i int)
SetVersion sets the "version" field.
func (*MessageMutation) Size ¶ added in v0.3.0
func (m *MessageMutation) Size() (r uint32, exists bool)
Size returns the value of the "size" field in the mutation.
func (*MessageMutation) SourceActor ¶ added in v0.3.0
func (m *MessageMutation) SourceActor() (r uint32, exists bool)
SourceActor returns the value of the "source_actor" field in the mutation.
func (*MessageMutation) SourceAddress ¶
func (m *MessageMutation) SourceAddress() (r string, exists bool)
SourceAddress returns the value of the "source_address" field in the mutation.
func (*MessageMutation) SourcePort ¶
func (m *MessageMutation) SourcePort() (r int, exists bool)
SourcePort returns the value of the "source_port" field in the mutation.
func (*MessageMutation) TargetActor ¶ added in v0.3.0
func (m *MessageMutation) TargetActor() (r uint32, exists bool)
TargetActor returns the value of the "target_actor" field in the mutation.
func (*MessageMutation) Timestamp ¶
func (m *MessageMutation) Timestamp() (r time.Time, exists bool)
Timestamp returns the value of the "timestamp" field in the mutation.
func (*MessageMutation) TimestampRaw ¶ added in v0.3.0
func (m *MessageMutation) TimestampRaw() (r uint32, exists bool)
TimestampRaw returns the value of the "timestamp_raw" field in the mutation.
func (*MessageMutation) TimestampRawCleared ¶ added in v0.3.0
func (m *MessageMutation) TimestampRawCleared() bool
TimestampRawCleared returns if the "timestamp_raw" field was cleared in this mutation.
func (MessageMutation) Tx ¶
func (m MessageMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*MessageMutation) Type ¶
func (m *MessageMutation) Type() string
Type returns the node type of this mutation (Message).
func (*MessageMutation) Version ¶
func (m *MessageMutation) Version() (r int, exists bool)
Version returns the value of the "version" field in the mutation.
func (*MessageMutation) Where ¶
func (m *MessageMutation) Where(ps ...predicate.Message)
Where appends a list predicates to the MessageMutation builder.
type MessageQuery ¶
type MessageQuery struct {
// contains filtered or unexported fields
}
MessageQuery is the builder for querying Message entities.
func (*MessageQuery) All ¶
func (mq *MessageQuery) All(ctx context.Context) ([]*Message, error)
All executes the query and returns a list of Messages.
func (*MessageQuery) AllX ¶
func (mq *MessageQuery) AllX(ctx context.Context) []*Message
AllX is like All, but panics if an error occurs.
func (*MessageQuery) Clone ¶
func (mq *MessageQuery) Clone() *MessageQuery
Clone returns a duplicate of the MessageQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*MessageQuery) Count ¶
func (mq *MessageQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*MessageQuery) CountX ¶
func (mq *MessageQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*MessageQuery) Exist ¶
func (mq *MessageQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*MessageQuery) ExistX ¶
func (mq *MessageQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*MessageQuery) First ¶
func (mq *MessageQuery) First(ctx context.Context) (*Message, error)
First returns the first Message entity from the query. Returns a *NotFoundError when no Message was found.
func (*MessageQuery) FirstID ¶
func (mq *MessageQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Message ID from the query. Returns a *NotFoundError when no Message ID was found.
func (*MessageQuery) FirstIDX ¶
func (mq *MessageQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*MessageQuery) FirstX ¶
func (mq *MessageQuery) FirstX(ctx context.Context) *Message
FirstX is like First, but panics if an error occurs.
func (*MessageQuery) GroupBy ¶
func (mq *MessageQuery) GroupBy(field string, fields ...string) *MessageGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct { Timestamp time.Time `json:"timestamp,omitempty"` Count int `json:"count,omitempty"` } client.Message.Query(). GroupBy(message.FieldTimestamp). Aggregate(ent.Count()). Scan(ctx, &v)
func (*MessageQuery) IDs ¶
func (mq *MessageQuery) IDs(ctx context.Context) ([]int, error)
IDs executes the query and returns a list of Message IDs.
func (*MessageQuery) IDsX ¶
func (mq *MessageQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*MessageQuery) Limit ¶
func (mq *MessageQuery) Limit(limit int) *MessageQuery
Limit adds a limit step to the query.
func (*MessageQuery) Offset ¶
func (mq *MessageQuery) Offset(offset int) *MessageQuery
Offset adds an offset step to the query.
func (*MessageQuery) Only ¶
func (mq *MessageQuery) Only(ctx context.Context) (*Message, error)
Only returns a single Message entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Message entity is found. Returns a *NotFoundError when no Message entities are found.
func (*MessageQuery) OnlyID ¶
func (mq *MessageQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Message ID in the query. Returns a *NotSingularError when more than one Message ID is found. Returns a *NotFoundError when no entities are found.
func (*MessageQuery) OnlyIDX ¶
func (mq *MessageQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*MessageQuery) OnlyX ¶
func (mq *MessageQuery) OnlyX(ctx context.Context) *Message
OnlyX is like Only, but panics if an error occurs.
func (*MessageQuery) Order ¶
func (mq *MessageQuery) Order(o ...OrderFunc) *MessageQuery
Order adds an order step to the query.
func (*MessageQuery) Select ¶
func (mq *MessageQuery) Select(fields ...string) *MessageSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct { Timestamp time.Time `json:"timestamp,omitempty"` } client.Message.Query(). Select(message.FieldTimestamp). Scan(ctx, &v)
func (*MessageQuery) Unique ¶
func (mq *MessageQuery) Unique(unique bool) *MessageQuery
Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.
func (*MessageQuery) Where ¶
func (mq *MessageQuery) Where(ps ...predicate.Message) *MessageQuery
Where adds a new predicate for the MessageQuery builder.
type MessageSelect ¶
type MessageSelect struct { *MessageQuery // contains filtered or unexported fields }
MessageSelect is the builder for selecting fields of Message entities.
func (*MessageSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*MessageSelect) Scan ¶
func (ms *MessageSelect) Scan(ctx context.Context, v interface{}) error
Scan applies the selector query and scans the result into the given value.
func (*MessageSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type MessageUpdate ¶
type MessageUpdate struct {
// contains filtered or unexported fields
}
MessageUpdate is the builder for updating Message entities.
func (*MessageUpdate) AddDestinationPort ¶
func (mu *MessageUpdate) AddDestinationPort(i int) *MessageUpdate
AddDestinationPort adds i to the "destination_port" field.
func (*MessageUpdate) AddOpcode ¶ added in v0.1.1
func (mu *MessageUpdate) AddOpcode(i int) *MessageUpdate
AddOpcode adds i to the "opcode" field.
func (*MessageUpdate) AddSegmentType ¶ added in v0.3.0
func (mu *MessageUpdate) AddSegmentType(i int) *MessageUpdate
AddSegmentType adds i to the "segment_type" field.
func (*MessageUpdate) AddServer ¶ added in v0.3.0
func (mu *MessageUpdate) AddServer(i int) *MessageUpdate
AddServer adds i to the "server" field.
func (*MessageUpdate) AddSize ¶ added in v0.3.0
func (mu *MessageUpdate) AddSize(u int32) *MessageUpdate
AddSize adds u to the "size" field.
func (*MessageUpdate) AddSourceActor ¶ added in v0.3.0
func (mu *MessageUpdate) AddSourceActor(u int32) *MessageUpdate
AddSourceActor adds u to the "source_actor" field.
func (*MessageUpdate) AddSourcePort ¶
func (mu *MessageUpdate) AddSourcePort(i int) *MessageUpdate
AddSourcePort adds i to the "source_port" field.
func (*MessageUpdate) AddTargetActor ¶ added in v0.3.0
func (mu *MessageUpdate) AddTargetActor(u int32) *MessageUpdate
AddTargetActor adds u to the "target_actor" field.
func (*MessageUpdate) AddTimestampRaw ¶ added in v0.3.0
func (mu *MessageUpdate) AddTimestampRaw(u int32) *MessageUpdate
AddTimestampRaw adds u to the "timestamp_raw" field.
func (*MessageUpdate) AddVersion ¶
func (mu *MessageUpdate) AddVersion(i int) *MessageUpdate
AddVersion adds i to the "version" field.
func (*MessageUpdate) ClearData ¶ added in v0.3.0
func (mu *MessageUpdate) ClearData() *MessageUpdate
ClearData clears the value of the "data" field.
func (*MessageUpdate) ClearOpcode ¶ added in v0.1.1
func (mu *MessageUpdate) ClearOpcode() *MessageUpdate
ClearOpcode clears the value of the "opcode" field.
func (*MessageUpdate) ClearServer ¶ added in v0.3.0
func (mu *MessageUpdate) ClearServer() *MessageUpdate
ClearServer clears the value of the "server" field.
func (*MessageUpdate) ClearTimestampRaw ¶ added in v0.3.0
func (mu *MessageUpdate) ClearTimestampRaw() *MessageUpdate
ClearTimestampRaw clears the value of the "timestamp_raw" field.
func (*MessageUpdate) Exec ¶
func (mu *MessageUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*MessageUpdate) ExecX ¶
func (mu *MessageUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MessageUpdate) Mutation ¶
func (mu *MessageUpdate) Mutation() *MessageMutation
Mutation returns the MessageMutation object of the builder.
func (*MessageUpdate) Save ¶
func (mu *MessageUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*MessageUpdate) SaveX ¶
func (mu *MessageUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*MessageUpdate) SetData ¶
func (mu *MessageUpdate) SetData(b []byte) *MessageUpdate
SetData sets the "data" field.
func (*MessageUpdate) SetDestinationAddress ¶
func (mu *MessageUpdate) SetDestinationAddress(s string) *MessageUpdate
SetDestinationAddress sets the "destination_address" field.
func (*MessageUpdate) SetDestinationPort ¶
func (mu *MessageUpdate) SetDestinationPort(i int) *MessageUpdate
SetDestinationPort sets the "destination_port" field.
func (*MessageUpdate) SetNillableOpcode ¶ added in v0.1.1
func (mu *MessageUpdate) SetNillableOpcode(i *int) *MessageUpdate
SetNillableOpcode sets the "opcode" field if the given value is not nil.
func (*MessageUpdate) SetNillableServer ¶ added in v0.3.0
func (mu *MessageUpdate) SetNillableServer(i *int) *MessageUpdate
SetNillableServer sets the "server" field if the given value is not nil.
func (*MessageUpdate) SetNillableTimestampRaw ¶ added in v0.3.0
func (mu *MessageUpdate) SetNillableTimestampRaw(u *uint32) *MessageUpdate
SetNillableTimestampRaw sets the "timestamp_raw" field if the given value is not nil.
func (*MessageUpdate) SetOpcode ¶ added in v0.1.1
func (mu *MessageUpdate) SetOpcode(i int) *MessageUpdate
SetOpcode sets the "opcode" field.
func (*MessageUpdate) SetSegmentType ¶ added in v0.3.0
func (mu *MessageUpdate) SetSegmentType(i int) *MessageUpdate
SetSegmentType sets the "segment_type" field.
func (*MessageUpdate) SetServer ¶ added in v0.3.0
func (mu *MessageUpdate) SetServer(i int) *MessageUpdate
SetServer sets the "server" field.
func (*MessageUpdate) SetSize ¶ added in v0.3.0
func (mu *MessageUpdate) SetSize(u uint32) *MessageUpdate
SetSize sets the "size" field.
func (*MessageUpdate) SetSourceActor ¶ added in v0.3.0
func (mu *MessageUpdate) SetSourceActor(u uint32) *MessageUpdate
SetSourceActor sets the "source_actor" field.
func (*MessageUpdate) SetSourceAddress ¶
func (mu *MessageUpdate) SetSourceAddress(s string) *MessageUpdate
SetSourceAddress sets the "source_address" field.
func (*MessageUpdate) SetSourcePort ¶
func (mu *MessageUpdate) SetSourcePort(i int) *MessageUpdate
SetSourcePort sets the "source_port" field.
func (*MessageUpdate) SetTargetActor ¶ added in v0.3.0
func (mu *MessageUpdate) SetTargetActor(u uint32) *MessageUpdate
SetTargetActor sets the "target_actor" field.
func (*MessageUpdate) SetTimestamp ¶
func (mu *MessageUpdate) SetTimestamp(t time.Time) *MessageUpdate
SetTimestamp sets the "timestamp" field.
func (*MessageUpdate) SetTimestampRaw ¶ added in v0.3.0
func (mu *MessageUpdate) SetTimestampRaw(u uint32) *MessageUpdate
SetTimestampRaw sets the "timestamp_raw" field.
func (*MessageUpdate) SetVersion ¶
func (mu *MessageUpdate) SetVersion(i int) *MessageUpdate
SetVersion sets the "version" field.
func (*MessageUpdate) Where ¶
func (mu *MessageUpdate) Where(ps ...predicate.Message) *MessageUpdate
Where appends a list predicates to the MessageUpdate builder.
type MessageUpdateOne ¶
type MessageUpdateOne struct {
// contains filtered or unexported fields
}
MessageUpdateOne is the builder for updating a single Message entity.
func (*MessageUpdateOne) AddDestinationPort ¶
func (muo *MessageUpdateOne) AddDestinationPort(i int) *MessageUpdateOne
AddDestinationPort adds i to the "destination_port" field.
func (*MessageUpdateOne) AddOpcode ¶ added in v0.1.1
func (muo *MessageUpdateOne) AddOpcode(i int) *MessageUpdateOne
AddOpcode adds i to the "opcode" field.
func (*MessageUpdateOne) AddSegmentType ¶ added in v0.3.0
func (muo *MessageUpdateOne) AddSegmentType(i int) *MessageUpdateOne
AddSegmentType adds i to the "segment_type" field.
func (*MessageUpdateOne) AddServer ¶ added in v0.3.0
func (muo *MessageUpdateOne) AddServer(i int) *MessageUpdateOne
AddServer adds i to the "server" field.
func (*MessageUpdateOne) AddSize ¶ added in v0.3.0
func (muo *MessageUpdateOne) AddSize(u int32) *MessageUpdateOne
AddSize adds u to the "size" field.
func (*MessageUpdateOne) AddSourceActor ¶ added in v0.3.0
func (muo *MessageUpdateOne) AddSourceActor(u int32) *MessageUpdateOne
AddSourceActor adds u to the "source_actor" field.
func (*MessageUpdateOne) AddSourcePort ¶
func (muo *MessageUpdateOne) AddSourcePort(i int) *MessageUpdateOne
AddSourcePort adds i to the "source_port" field.
func (*MessageUpdateOne) AddTargetActor ¶ added in v0.3.0
func (muo *MessageUpdateOne) AddTargetActor(u int32) *MessageUpdateOne
AddTargetActor adds u to the "target_actor" field.
func (*MessageUpdateOne) AddTimestampRaw ¶ added in v0.3.0
func (muo *MessageUpdateOne) AddTimestampRaw(u int32) *MessageUpdateOne
AddTimestampRaw adds u to the "timestamp_raw" field.
func (*MessageUpdateOne) AddVersion ¶
func (muo *MessageUpdateOne) AddVersion(i int) *MessageUpdateOne
AddVersion adds i to the "version" field.
func (*MessageUpdateOne) ClearData ¶ added in v0.3.0
func (muo *MessageUpdateOne) ClearData() *MessageUpdateOne
ClearData clears the value of the "data" field.
func (*MessageUpdateOne) ClearOpcode ¶ added in v0.1.1
func (muo *MessageUpdateOne) ClearOpcode() *MessageUpdateOne
ClearOpcode clears the value of the "opcode" field.
func (*MessageUpdateOne) ClearServer ¶ added in v0.3.0
func (muo *MessageUpdateOne) ClearServer() *MessageUpdateOne
ClearServer clears the value of the "server" field.
func (*MessageUpdateOne) ClearTimestampRaw ¶ added in v0.3.0
func (muo *MessageUpdateOne) ClearTimestampRaw() *MessageUpdateOne
ClearTimestampRaw clears the value of the "timestamp_raw" field.
func (*MessageUpdateOne) Exec ¶
func (muo *MessageUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*MessageUpdateOne) ExecX ¶
func (muo *MessageUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*MessageUpdateOne) Mutation ¶
func (muo *MessageUpdateOne) Mutation() *MessageMutation
Mutation returns the MessageMutation object of the builder.
func (*MessageUpdateOne) Save ¶
func (muo *MessageUpdateOne) Save(ctx context.Context) (*Message, error)
Save executes the query and returns the updated Message entity.
func (*MessageUpdateOne) SaveX ¶
func (muo *MessageUpdateOne) SaveX(ctx context.Context) *Message
SaveX is like Save, but panics if an error occurs.
func (*MessageUpdateOne) Select ¶
func (muo *MessageUpdateOne) Select(field string, fields ...string) *MessageUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*MessageUpdateOne) SetData ¶
func (muo *MessageUpdateOne) SetData(b []byte) *MessageUpdateOne
SetData sets the "data" field.
func (*MessageUpdateOne) SetDestinationAddress ¶
func (muo *MessageUpdateOne) SetDestinationAddress(s string) *MessageUpdateOne
SetDestinationAddress sets the "destination_address" field.
func (*MessageUpdateOne) SetDestinationPort ¶
func (muo *MessageUpdateOne) SetDestinationPort(i int) *MessageUpdateOne
SetDestinationPort sets the "destination_port" field.
func (*MessageUpdateOne) SetNillableOpcode ¶ added in v0.1.1
func (muo *MessageUpdateOne) SetNillableOpcode(i *int) *MessageUpdateOne
SetNillableOpcode sets the "opcode" field if the given value is not nil.
func (*MessageUpdateOne) SetNillableServer ¶ added in v0.3.0
func (muo *MessageUpdateOne) SetNillableServer(i *int) *MessageUpdateOne
SetNillableServer sets the "server" field if the given value is not nil.
func (*MessageUpdateOne) SetNillableTimestampRaw ¶ added in v0.3.0
func (muo *MessageUpdateOne) SetNillableTimestampRaw(u *uint32) *MessageUpdateOne
SetNillableTimestampRaw sets the "timestamp_raw" field if the given value is not nil.
func (*MessageUpdateOne) SetOpcode ¶ added in v0.1.1
func (muo *MessageUpdateOne) SetOpcode(i int) *MessageUpdateOne
SetOpcode sets the "opcode" field.
func (*MessageUpdateOne) SetSegmentType ¶ added in v0.3.0
func (muo *MessageUpdateOne) SetSegmentType(i int) *MessageUpdateOne
SetSegmentType sets the "segment_type" field.
func (*MessageUpdateOne) SetServer ¶ added in v0.3.0
func (muo *MessageUpdateOne) SetServer(i int) *MessageUpdateOne
SetServer sets the "server" field.
func (*MessageUpdateOne) SetSize ¶ added in v0.3.0
func (muo *MessageUpdateOne) SetSize(u uint32) *MessageUpdateOne
SetSize sets the "size" field.
func (*MessageUpdateOne) SetSourceActor ¶ added in v0.3.0
func (muo *MessageUpdateOne) SetSourceActor(u uint32) *MessageUpdateOne
SetSourceActor sets the "source_actor" field.
func (*MessageUpdateOne) SetSourceAddress ¶
func (muo *MessageUpdateOne) SetSourceAddress(s string) *MessageUpdateOne
SetSourceAddress sets the "source_address" field.
func (*MessageUpdateOne) SetSourcePort ¶
func (muo *MessageUpdateOne) SetSourcePort(i int) *MessageUpdateOne
SetSourcePort sets the "source_port" field.
func (*MessageUpdateOne) SetTargetActor ¶ added in v0.3.0
func (muo *MessageUpdateOne) SetTargetActor(u uint32) *MessageUpdateOne
SetTargetActor sets the "target_actor" field.
func (*MessageUpdateOne) SetTimestamp ¶
func (muo *MessageUpdateOne) SetTimestamp(t time.Time) *MessageUpdateOne
SetTimestamp sets the "timestamp" field.
func (*MessageUpdateOne) SetTimestampRaw ¶ added in v0.3.0
func (muo *MessageUpdateOne) SetTimestampRaw(u uint32) *MessageUpdateOne
SetTimestampRaw sets the "timestamp_raw" field.
func (*MessageUpdateOne) SetVersion ¶
func (muo *MessageUpdateOne) SetVersion(i int) *MessageUpdateOne
SetVersion sets the "version" field.
type MutateFunc ¶
type MutateFunc = ent.MutateFunc
ent aliases to avoid import conflicts in user's code.
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
NotFoundError returns when trying to fetch a specific entity and it was not found in the database.
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
Error implements the error interface.
type NotLoadedError ¶
type NotLoadedError struct {
// contains filtered or unexported fields
}
NotLoadedError returns when trying to get a node that was not loaded by the query.
func (*NotLoadedError) Error ¶
func (e *NotLoadedError) Error() string
Error implements the error interface.
type NotSingularError ¶
type NotSingularError struct {
// contains filtered or unexported fields
}
NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.
func (*NotSingularError) Error ¶
func (e *NotSingularError) Error() string
Error implements the error interface.
type RollbackFunc ¶
The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.
type RollbackHook ¶
type RollbackHook func(Rollbacker) Rollbacker
RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:
hook := func(next ent.Rollbacker) ent.Rollbacker { return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error { // Do some stuff before. if err := next.Rollback(ctx, tx); err != nil { return err } // Do some stuff after. return nil }) }
type Rollbacker ¶
Rollbacker is the interface that wraps the Rollback method.
type Tx ¶
type Tx struct { // LogEvent is the client for interacting with the LogEvent builders. LogEvent *LogEventClient // Message is the client for interacting with the Message builders. Message *MessageClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type ValidationError ¶
type ValidationError struct { Name string // Field or edge name. // contains filtered or unexported fields }
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.