Documentation ¶
Index ¶
- Variables
- type Action
- type ColumnInfo
- type Configuration
- type ConfigurationCache
- type Device
- type DeviceJoin
- type DeviceSet
- type DevicesManifests
- type Manifest
- type ManifestJoin
- type Model
- type Namespace
- type NamespaceJoin
- type NamespacesManifests
- type Reference
- type Repo
- type Secret
- type SecretsManifests
- type SetJoin
- type SetsManifests
- type TableInfo
Constants ¶
This section is empty.
Variables ¶
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 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 ¶
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.
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 ¶
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.
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 ¶
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.
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 ¶
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.
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 ¶
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.
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 ¶
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.
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 ¶
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.
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 ¶
GetTableInfo retrieve TableInfo for a table