pg

package
v0.0.0-...-bff9524 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Create action when record is created
	Create = Action(0)

	// RetrieveOne action when a record is retrieved from db
	RetrieveOne = Action(1)

	// RetrieveMany action when record(s) are retrieved from db
	RetrieveMany = Action(2)

	// Update action when record is updated in db
	Update = Action(3)

	// Delete action when record is deleted in db
	Delete = Action(4)

	// FetchDDL action when fetching ddl info from db
	FetchDDL = Action(5)
)

Functions

This section is empty.

Types

type Action

type Action int32

Action CRUD actions

func (Action) String

func (i Action) String() string

String describe the action

type ColumnInfo

type ColumnInfo struct {
	Index              int    `json:"index"`
	GoFieldName        string `json:"go_field_name"`
	GoFieldType        string `json:"go_field_type"`
	JSONFieldName      string `json:"json_field_name"`
	ProtobufFieldName  string `json:"protobuf_field_name"`
	ProtobufType       string `json:"protobuf_field_type"`
	ProtobufPos        int    `json:"protobuf_field_pos"`
	Comment            string `json:"comment"`
	Notes              string `json:"notes"`
	Name               string `json:"name"`
	Nullable           bool   `json:"is_nullable"`
	DatabaseTypeName   string `json:"database_type_name"`
	DatabaseTypePretty string `json:"database_type_pretty"`
	IsPrimaryKey       bool   `json:"is_primary_key"`
	IsAutoIncrement    bool   `json:"is_auto_increment"`
	IsArray            bool   `json:"is_array"`
	ColumnType         string `json:"column_type"`
	ColumnLength       int64  `json:"column_length"`
	DefaultValue       string `json:"default_value"`
}

ColumnInfo describes a column in the database table

type Configuration

type Configuration struct {
	//[ 0] id                                             TEXT                 null: false  primary: true   isArray: false  auto: false  col: TEXT            len: -1      default: []
	ID string `gorm:"primary_key;column:id;type:TEXT;"`
	//[ 1] heartbeat_period_seconds                       INT2                 null: true   primary: false  isArray: false  auto: false  col: INT2            len: -1      default: [30]
	HeartbeatPeriodSeconds sql.NullInt64 `gorm:"column:heartbeat_period_seconds;type:INT2;default:30;"`
	//[ 2] log_level                                      TEXT                 null: true   primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: [info]
	LogLevel sql.NullString `gorm:"column:log_level;type:TEXT;default:info;"`
}

Configuration struct is a row record of the configuration table in the tinyedge database

func (*Configuration) BeforeSave

func (c *Configuration) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*Configuration) Prepare

func (c *Configuration) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*Configuration) TableInfo

func (c *Configuration) TableInfo() *TableInfo

TableInfo return table meta data

func (*Configuration) TableName

func (c *Configuration) TableName() string

TableName sets the insert table name for this struct type

func (*Configuration) Validate

func (c *Configuration) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type ConfigurationCache

type ConfigurationCache struct {
	//[ 0] id                                             TEXT                 null: false  primary: true   isArray: false  auto: false  col: TEXT            len: -1      default: []
	ID string `gorm:"primary_key;column:id;type:TEXT;"`
	//[ 1] workload                                       BYTEA                null: true   primary: false  isArray: false  auto: false  col: BYTEA           len: -1      default: []
	Workload sql.NullString `gorm:"column:workload;type:BYTEA;"`
}

ConfigurationCache struct is a row record of the configuration_cache table in the tinyedge database

func (*ConfigurationCache) BeforeSave

func (c *ConfigurationCache) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*ConfigurationCache) Prepare

func (c *ConfigurationCache) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*ConfigurationCache) TableInfo

func (c *ConfigurationCache) TableInfo() *TableInfo

TableInfo return table meta data

func (*ConfigurationCache) TableName

func (c *ConfigurationCache) TableName() string

TableName sets the insert table name for this struct type

func (*ConfigurationCache) Validate

func (c *ConfigurationCache) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type Device

type Device struct {
	//[ 0] id                                             TEXT                 null: false  primary: true   isArray: false  auto: false  col: TEXT            len: -1      default: []
	ID string `gorm:"primary_key;column:id;type:TEXT;"`
	//[ 1] enroled_at                                     TIMESTAMP            null: true   primary: false  isArray: false  auto: false  col: TIMESTAMP       len: -1      default: []
	EnroledAt time.Time `gorm:"column:enroled_at;type:TIMESTAMP;"`
	//[ 2] registered_at                                  TIMESTAMP            null: true   primary: false  isArray: false  auto: false  col: TIMESTAMP       len: -1      default: []
	RegisteredAt time.Time `gorm:"column:registered_at;type:TIMESTAMP;"`
	//[ 3] enroled                                        TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: [not_enroled]
	Enroled string `gorm:"column:enroled;type:TEXT;default:not_enroled;"`
	//[ 4] registered                                     BOOL                 null: false  primary: false  isArray: false  auto: false  col: BOOL            len: -1      default: [false]
	Registered bool `gorm:"column:registered;type:BOOL;default:false;"`
	//[ 5] certificate_sn                                 TEXT                 null: true   primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	CertificateSn sql.NullString `gorm:"column:certificate_sn;type:TEXT;"`
	//[ 6] namespace_id                                   VARCHAR(255)         null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	NamespaceID string `gorm:"column:namespace_id;type:VARCHAR;size:255;"`
	//[ 7] device_set_id                                  VARCHAR(255)         null: true   primary: false  isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	DeviceSetID sql.NullString `gorm:"column:device_set_id;type:VARCHAR;size:255;"`
}

Device struct is a row record of the device table in the tinyedge database

func (*Device) BeforeSave

func (d *Device) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*Device) Prepare

func (d *Device) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*Device) TableInfo

func (d *Device) TableInfo() *TableInfo

TableInfo return table meta data

func (*Device) TableName

func (d *Device) TableName() string

TableName sets the insert table name for this struct type

func (*Device) Validate

func (d *Device) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type DeviceJoin

type DeviceJoin struct {
	Device
	ConfigurationID        string `gorm:"column:conf_id;type:TEXT"`
	ConfigurationPath      string `gorm:"column:conf_path;type:TEXT"`
	ConfigurationLocalPath string `gorm:"column:conf_local_path;type:TEXT"`
	WorkloadID             string `gorm:"column:workload_id;type:TEXT"`
	WorkloadRepoLocalPath  string `gorm:"column:workload_repo_local_path;type:TEXT"`
	WorkloadPath           string `gorm:"column:workload_path;type:TEXT"`
}

type DeviceSet

type DeviceSet struct {
	//[ 0] id                                             TEXT                 null: false  primary: true   isArray: false  auto: false  col: TEXT            len: -1      default: []
	ID string `gorm:"primary_key;column:id;type:TEXT;"`
	//[ 1] namespace_id                                   VARCHAR(255)         null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	NamespaceID string `gorm:"column:namespace_id;type:VARCHAR;size:255;"`
}

DeviceSet struct is a row record of the device_set table in the tinyedge database

func (*DeviceSet) BeforeSave

func (d *DeviceSet) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*DeviceSet) Prepare

func (d *DeviceSet) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*DeviceSet) TableInfo

func (d *DeviceSet) TableInfo() *TableInfo

TableInfo return table meta data

func (*DeviceSet) TableName

func (d *DeviceSet) TableName() string

TableName sets the insert table name for this struct type

func (*DeviceSet) Validate

func (d *DeviceSet) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type DevicesManifests

type DevicesManifests struct {
	//[ 0] device_id                                      VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	DeviceID string `gorm:"primary_key;column:device_id;type:VARCHAR;size:255;"`
	//[ 1] manifest_id                                    VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	ManifestID string `gorm:"primary_key;column:manifest_id;type:VARCHAR;size:255;"`
}

DevicesManifests struct is a row record of the devices_manifests table in the tinyedge database

func (*DevicesManifests) BeforeSave

func (d *DevicesManifests) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*DevicesManifests) Prepare

func (d *DevicesManifests) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*DevicesManifests) TableInfo

func (d *DevicesManifests) TableInfo() *TableInfo

TableInfo return table meta data

func (*DevicesManifests) TableName

func (d *DevicesManifests) TableName() string

TableName sets the insert table name for this struct type

func (*DevicesManifests) Validate

func (d *DevicesManifests) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type Manifest

type Manifest struct {
	//[ 0] id                                             VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	ID string `gorm:"primary_key;column:id;type:VARCHAR;size:255;"`
	//[ 1] version                                        VARCHAR(30)          null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 30      default: []
	Version string `gorm:"column:version;type:VARCHAR;size:30;"`
	//[ 2] repo_id                                        VARCHAR(255)         null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	RepoID string `gorm:"column:repo_id;type:VARCHAR;size:255;"`
	//[ 3] path                                           TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	Path string `gorm:"column:path;type:TEXT;"`
}

Manifest struct is a row record of the manifest table in the tinyedge database

func (*Manifest) BeforeSave

func (m *Manifest) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*Manifest) Prepare

func (m *Manifest) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*Manifest) TableInfo

func (m *Manifest) TableInfo() *TableInfo

TableInfo return table meta data

func (*Manifest) TableName

func (m *Manifest) TableName() string

TableName sets the insert table name for this struct type

func (*Manifest) Validate

func (m *Manifest) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type ManifestJoin

type ManifestJoin struct {
	Manifest
	DeviceId              string         `gorm:"column:device_id;type:TEXT"`
	SetId                 string         `gorm:"column:set_id;type:TEXT"`
	NamespaceId           string         `gorm:"column:namespace_id;type:TEXT"`
	RepoID                string         `gorm:"column:repo_id;type:TEXT;"`
	RepoURL               string         `gorm:"column:repo_url;type:TEXT;"`
	RepoBranch            sql.NullString `gorm:"column:repo_branch;type:TEXT;"`
	RepoLocalPath         sql.NullString `gorm:"column:repo_local_path;type:TEXT;"`
	RepoAuth              sql.NullString `gorm:"column:repo_auth_type;type:TEXT;"`
	RepoAuthSecret        sql.NullString `gorm:"column:repo_auth_secret_path;type:TEXT;"`
	RepoCurrentHeadSha    sql.NullString `gorm:"column:repo_current_head_sha;type:TEXT;"`
	RepoTargetHeadSha     sql.NullString `gorm:"column:repo_target_head_sha;type:TEXT;"`
	RepoPullPeriodSeconds sql.NullInt64  `gorm:"column:repo_pull_period_seconds;type:INT2;default:20;"`
}

type Model

type Model interface {
	TableName() string
	BeforeSave() error
	Prepare()
	Validate(action Action) error
	TableInfo() *TableInfo
}

Model interface methods for database structs generated

type Namespace

type Namespace struct {
	//[ 0] id                                             TEXT                 null: false  primary: true   isArray: false  auto: false  col: TEXT            len: -1      default: []
	ID string `gorm:"primary_key;column:id;type:TEXT;"`
	//[ 1] is_default                                     BOOL                 null: true   primary: false  isArray: false  auto: false  col: BOOL            len: -1      default: [false]
	IsDefault sql.NullBool `gorm:"column:is_default;type:BOOL;default:false;"`
}

Namespace struct is a row record of the namespace table in the tinyedge database

func (*Namespace) BeforeSave

func (n *Namespace) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*Namespace) Prepare

func (n *Namespace) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*Namespace) TableInfo

func (n *Namespace) TableInfo() *TableInfo

TableInfo return table meta data

func (*Namespace) TableName

func (n *Namespace) TableName() string

TableName sets the insert table name for this struct type

func (*Namespace) Validate

func (n *Namespace) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type NamespaceJoin

type NamespaceJoin struct {
	Namespace
	DeviceId               string `gorm:"column:device_id;type:TEXT"`
	SetId                  string `gorm:"column:set_id;type:TEXT"`
	ConfigurationID        string `gorm:"column:conf_id;type:TEXT"`
	ConfigurationPath      string `gorm:"column:conf_path;type:TEXT"`
	ConfigurationLocalPath string `gorm:"column:conf_local_path;type:TEXT"`
	WorkloadID             string `gorm:"column:workload_id;type:TEXT"`
	WorkloadRepoLocalPath  string `gorm:"column:workload_repo_local_path;type:TEXT"`
	WorkloadPath           string `gorm:"column:workload_path;type:TEXT"`
}

type NamespacesManifests

type NamespacesManifests struct {
	//[ 0] namespace_id                                   VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	NamespaceID string `gorm:"primary_key;column:namespace_id;type:VARCHAR;size:255;"`
	//[ 1] manifest_id                                    VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	ManifestID string `gorm:"primary_key;column:manifest_id;type:VARCHAR;size:255;"`
}

NamespacesManifests struct is a row record of the namespaces_manifests table in the tinyedge database

func (*NamespacesManifests) BeforeSave

func (n *NamespacesManifests) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*NamespacesManifests) Prepare

func (n *NamespacesManifests) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*NamespacesManifests) TableInfo

func (n *NamespacesManifests) TableInfo() *TableInfo

TableInfo return table meta data

func (*NamespacesManifests) TableName

func (n *NamespacesManifests) TableName() string

TableName sets the insert table name for this struct type

func (*NamespacesManifests) Validate

func (n *NamespacesManifests) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type Reference

type Reference struct {
	//[ 0] id                                             VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	ID string `gorm:"primary_key;column:id;type:VARCHAR;size:255;"`
	//[ 1] ref_type                                       USER_DEFINED         null: false  primary: false  isArray: false  auto: false  col: USER_DEFINED    len: -1      default: []
	RefType string `gorm:"column:ref_type;type:VARCHAR;"`
	//[ 2] name                                           VARCHAR(255)         null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	Name string `gorm:"column:name;type:VARCHAR;size:255;"`
	//[ 3] repo_id                                        VARCHAR(255)         null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	RepoID string `gorm:"column:repo_id;type:VARCHAR;size:255;"`
	//[ 4] valid                                          BOOL                 null: false  primary: false  isArray: false  auto: false  col: BOOL            len: -1      default: []
	Valid bool `gorm:"column:valid;type:BOOL;"`
	//[ 5] hash                                           TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	Hash string `gorm:"column:hash;type:TEXT;"`
	//[ 6] path_reference                                 TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	PathReference string `gorm:"column:path_reference;type:TEXT;"`
}

Reference struct is a row record of the reference table in the tinyedge database

func (*Reference) BeforeSave

func (r *Reference) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*Reference) Prepare

func (r *Reference) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*Reference) TableInfo

func (r *Reference) TableInfo() *TableInfo

TableInfo return table meta data

func (*Reference) TableName

func (r *Reference) TableName() string

TableName sets the insert table name for this struct type

func (*Reference) Validate

func (r *Reference) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type Repo

type Repo struct {
	//[ 0] id                                             VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	ID string `gorm:"primary_key;column:id;type:VARCHAR;size:255;"`
	//[ 1] url                                            TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	URL string `gorm:"column:url;type:TEXT;"`
	//[ 2] branch                                         TEXT                 null: true   primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	Branch sql.NullString `gorm:"column:branch;type:TEXT;"`
	//[ 3] local_path                                     TEXT                 null: true   primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	LocalPath sql.NullString `gorm:"column:local_path;type:TEXT;"`
	//[ 4] auth_type                                      VARCHAR(20)          null: true   primary: false  isArray: false  auto: false  col: VARCHAR         len: 20      default: []
	AuthType sql.NullString `gorm:"column:auth_type;type:VARCHAR;size:20;"`
	//[ 5] auth_secret_path                               VARCHAR(20)          null: true   primary: false  isArray: false  auto: false  col: VARCHAR         len: 20      default: []
	AuthSecretPath sql.NullString `gorm:"column:auth_secret_path;type:VARCHAR;size:20;"`
	//[ 6] current_head_sha                               TEXT                 null: true   primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	CurrentHeadSha sql.NullString `gorm:"column:current_head_sha;type:TEXT;"`
	//[ 7] target_head_sha                                TEXT                 null: true   primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	TargetHeadSha sql.NullString `gorm:"column:target_head_sha;type:TEXT;"`
	//[ 8] pull_period_seconds                            INT2                 null: true   primary: false  isArray: false  auto: false  col: INT2            len: -1      default: [20]
	PullPeriodSeconds sql.NullInt64 `gorm:"column:pull_period_seconds;type:INT2;default:20;"`
}

Repo struct is a row record of the repo table in the tinyedge database

func (*Repo) BeforeSave

func (r *Repo) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*Repo) Prepare

func (r *Repo) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*Repo) TableInfo

func (r *Repo) TableInfo() *TableInfo

TableInfo return table meta data

func (*Repo) TableName

func (r *Repo) TableName() string

TableName sets the insert table name for this struct type

func (*Repo) Validate

func (r *Repo) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type Secret

type Secret struct {
	//[ 0] id                                             VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	ID string `gorm:"primary_key;column:id;type:VARCHAR;size:255;"`
	//[ 1] path                                           VARCHAR(255)         null: false  primary: false  isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	Path string `gorm:"column:path;type:VARCHAR;size:255;"`
	//[ 2] current_hash                                   TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	CurrentHash string `gorm:"column:current_hash;type:TEXT;"`
	//[ 3] target_hash                                    TEXT                 null: false  primary: false  isArray: false  auto: false  col: TEXT            len: -1      default: []
	TargetHash string `gorm:"column:target_hash;type:TEXT;"`
}

Secret struct is a row record of the secret table in the tinyedge database

func (*Secret) BeforeSave

func (s *Secret) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*Secret) Prepare

func (s *Secret) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*Secret) TableInfo

func (s *Secret) TableInfo() *TableInfo

TableInfo return table meta data

func (*Secret) TableName

func (s *Secret) TableName() string

TableName sets the insert table name for this struct type

func (*Secret) Validate

func (s *Secret) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type SecretsManifests

type SecretsManifests struct {
	//[ 0] secret_id                                      VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	SecretID string `gorm:"primary_key;column:secret_id;type:VARCHAR;size:255;"`
	//[ 1] manifest_id                                    VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	ManifestID string `gorm:"primary_key;column:manifest_id;type:VARCHAR;size:255;"`
}

SecretsManifests struct is a row record of the secrets_manifests table in the tinyedge database

func (*SecretsManifests) BeforeSave

func (s *SecretsManifests) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*SecretsManifests) Prepare

func (s *SecretsManifests) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*SecretsManifests) TableInfo

func (s *SecretsManifests) TableInfo() *TableInfo

TableInfo return table meta data

func (*SecretsManifests) TableName

func (s *SecretsManifests) TableName() string

TableName sets the insert table name for this struct type

func (*SecretsManifests) Validate

func (s *SecretsManifests) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type SetJoin

type SetJoin struct {
	DeviceSet
	DeviceId               string `gorm:"column:device_id;type:TEXT"`
	ConfigurationID        string `gorm:"column:conf_id;type:TEXT"`
	ConfigurationPath      string `gorm:"column:conf_path;type:TEXT"`
	ConfigurationLocalPath string `gorm:"column:conf_local_path;type:TEXT"`
	WorkloadID             string `gorm:"column:workload_id;type:TEXT"`
	WorkloadRepoLocalPath  string `gorm:"column:workload_repo_local_path;type:TEXT"`
	WorkloadPath           string `gorm:"column:workload_path;type:TEXT"`
}

type SetsManifests

type SetsManifests struct {
	//[ 0] device_set_id                                  VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	DeviceSetID string `gorm:"primary_key;column:device_set_id;type:VARCHAR;size:255;"`
	//[ 1] manifest_id                                    VARCHAR(255)         null: false  primary: true   isArray: false  auto: false  col: VARCHAR         len: 255     default: []
	ManifestID string `gorm:"primary_key;column:manifest_id;type:VARCHAR;size:255;"`
}

SetsManifests struct is a row record of the sets_manifests table in the tinyedge database

func (*SetsManifests) BeforeSave

func (s *SetsManifests) BeforeSave() error

BeforeSave invoked before saving, return an error if field is not populated.

func (*SetsManifests) Prepare

func (s *SetsManifests) Prepare()

Prepare invoked before saving, can be used to populate fields etc.

func (*SetsManifests) TableInfo

func (s *SetsManifests) TableInfo() *TableInfo

TableInfo return table meta data

func (*SetsManifests) TableName

func (s *SetsManifests) TableName() string

TableName sets the insert table name for this struct type

func (*SetsManifests) Validate

func (s *SetsManifests) Validate(action Action) error

Validate invoked before performing action, return an error if field is not populated.

type TableInfo

type TableInfo struct {
	Name    string        `json:"name"`
	Columns []*ColumnInfo `json:"columns"`
}

TableInfo describes a table in the database

func GetTableInfo

func GetTableInfo(name string) (*TableInfo, bool)

GetTableInfo retrieve TableInfo for a table

Jump to

Keyboard shortcuts

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