models

package
v0.0.0-...-62f7a63 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.

View Source
var PeerColumns = struct {
	ID             string
	MultiHash      string
	AgentVersion   string
	Protocols      string
	MultiAddresses string
	IPAddresses    string
	Countries      string
	Continents     string
	Asns           string
	TargetType     string
	TargetName     string
	LastSeenAt     string
	UpdatedAt      string
	CreatedAt      string
}{
	ID:             "id",
	MultiHash:      "multi_hash",
	AgentVersion:   "agent_version",
	Protocols:      "protocols",
	MultiAddresses: "multi_addresses",
	IPAddresses:    "ip_addresses",
	Countries:      "countries",
	Continents:     "continents",
	Asns:           "asns",
	TargetType:     "target_type",
	TargetName:     "target_name",
	LastSeenAt:     "last_seen_at",
	UpdatedAt:      "updated_at",
	CreatedAt:      "created_at",
}
View Source
var PeerRels = struct {
}{}

PeerRels is where relationship names are stored.

View Source
var PeerTableColumns = struct {
	ID             string
	MultiHash      string
	AgentVersion   string
	Protocols      string
	MultiAddresses string
	IPAddresses    string
	Countries      string
	Continents     string
	Asns           string
	TargetType     string
	TargetName     string
	LastSeenAt     string
	UpdatedAt      string
	CreatedAt      string
}{
	ID:             "peers.id",
	MultiHash:      "peers.multi_hash",
	AgentVersion:   "peers.agent_version",
	Protocols:      "peers.protocols",
	MultiAddresses: "peers.multi_addresses",
	IPAddresses:    "peers.ip_addresses",
	Countries:      "peers.countries",
	Continents:     "peers.continents",
	Asns:           "peers.asns",
	TargetType:     "peers.target_type",
	TargetName:     "peers.target_name",
	LastSeenAt:     "peers.last_seen_at",
	UpdatedAt:      "peers.updated_at",
	CreatedAt:      "peers.created_at",
}
View Source
var PeerWhere = struct {
	ID             whereHelperint64
	MultiHash      whereHelperstring
	AgentVersion   whereHelpernull_String
	Protocols      whereHelpertypes_StringArray
	MultiAddresses whereHelpertypes_StringArray
	IPAddresses    whereHelpertypes_StringArray
	Countries      whereHelpertypes_StringArray
	Continents     whereHelpertypes_StringArray
	Asns           whereHelpertypes_Int64Array
	TargetType     whereHelperstring
	TargetName     whereHelperstring
	LastSeenAt     whereHelpertime_Time
	UpdatedAt      whereHelpertime_Time
	CreatedAt      whereHelpertime_Time
}{
	ID:             whereHelperint64{/* contains filtered or unexported fields */},
	MultiHash:      whereHelperstring{/* contains filtered or unexported fields */},
	AgentVersion:   whereHelpernull_String{/* contains filtered or unexported fields */},
	Protocols:      whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	MultiAddresses: whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	IPAddresses:    whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	Countries:      whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	Continents:     whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	Asns:           whereHelpertypes_Int64Array{/* contains filtered or unexported fields */},
	TargetType:     whereHelperstring{/* contains filtered or unexported fields */},
	TargetName:     whereHelperstring{/* contains filtered or unexported fields */},
	LastSeenAt:     whereHelpertime_Time{/* contains filtered or unexported fields */},
	UpdatedAt:      whereHelpertime_Time{/* contains filtered or unexported fields */},
	CreatedAt:      whereHelpertime_Time{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Peers string
}{
	Peers: "peers",
}
View Source
var ViewNames = struct {
}{}

Functions

func AddPeerHook

func AddPeerHook(hookPoint boil.HookPoint, peerHook PeerHook)

AddPeerHook registers your hook function for all future operations.

func NewQuery

func NewQuery(mods ...qm.QueryMod) *queries.Query

NewQuery initializes a new Query using the passed in QueryMods

func PeerExists

func PeerExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

PeerExists checks if the Peer row exists.

func Peers

func Peers(mods ...qm.QueryMod) peerQuery

Peers retrieves all the records using an executor.

Types

type M

type M map[string]interface{}

M type is for providing columns and column values to UpdateAll.

type Peer

type Peer struct {
	ID             int64             `boil:"id" json:"id" toml:"id" yaml:"id"`
	MultiHash      string            `boil:"multi_hash" json:"multi_hash" toml:"multi_hash" yaml:"multi_hash"`
	AgentVersion   null.String       `boil:"agent_version" json:"agent_version,omitempty" toml:"agent_version" yaml:"agent_version,omitempty"`
	Protocols      types.StringArray `boil:"protocols" json:"protocols,omitempty" toml:"protocols" yaml:"protocols,omitempty"`
	MultiAddresses types.StringArray `boil:"multi_addresses" json:"multi_addresses" toml:"multi_addresses" yaml:"multi_addresses"`
	IPAddresses    types.StringArray `boil:"ip_addresses" json:"ip_addresses" toml:"ip_addresses" yaml:"ip_addresses"`
	Countries      types.StringArray `boil:"countries" json:"countries" toml:"countries" yaml:"countries"`
	Continents     types.StringArray `boil:"continents" json:"continents" toml:"continents" yaml:"continents"`
	Asns           types.Int64Array  `boil:"asns" json:"asns" toml:"asns" yaml:"asns"`
	TargetType     string            `boil:"target_type" json:"target_type" toml:"target_type" yaml:"target_type"`
	TargetName     string            `boil:"target_name" json:"target_name" toml:"target_name" yaml:"target_name"`
	LastSeenAt     time.Time         `boil:"last_seen_at" json:"last_seen_at" toml:"last_seen_at" yaml:"last_seen_at"`
	UpdatedAt      time.Time         `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"`
	CreatedAt      time.Time         `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`

	R *peerR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L peerL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Peer is an object representing the database table.

func FindPeer

func FindPeer(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Peer, error)

FindPeer retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*Peer) Delete

func (o *Peer) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single Peer record with an executor. Delete will match against the primary key column to find the record to delete.

func (*Peer) Insert

func (o *Peer) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*Peer) Reload

func (o *Peer) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Peer) Update

func (o *Peer) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the Peer. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*Peer) Upsert

func (o *Peer) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type PeerHook

type PeerHook func(context.Context, boil.ContextExecutor, *Peer) error

PeerHook is the signature for custom Peer hook methods

type PeerSlice

type PeerSlice []*Peer

PeerSlice is an alias for a slice of pointers to Peer. This should almost always be used instead of []Peer.

func (PeerSlice) DeleteAll

func (o PeerSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*PeerSlice) ReloadAll

func (o *PeerSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (PeerSlice) UpdateAll

func (o PeerSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL