Documentation ¶
Index ¶
- func New() (plugin.Plugin, error)
- type CloudConfig
- type DB
- func (d *DB) Close() error
- func (d *DB) CountApplication(tx *sqlx.Tx, name, namespace string) (int, error)
- func (d *DB) CountBatch(ns, name string) (int, error)
- func (d *DB) CountBatchByCallback(callbackName, ns string) (int, error)
- func (d *DB) CountBatchByCallbackTx(tx *sqlx.Tx, callbackName, ns string) (int, error)
- func (d *DB) CountBatchTx(tx *sqlx.Tx, ns, name string) (int, error)
- func (d DB) CountCertByParentId(parentId string) (int, error)
- func (d *DB) CountProperty(name string) (int, error)
- func (d *DB) CountRecord(batchName, fingerprintValue, ns string) (int, error)
- func (d *DB) CountRecordTx(tx *sqlx.Tx, batchName, fingerprintValue, ns string) (int, error)
- func (d *DB) CountTask(task *models.Task) (int, error)
- func (d *DB) Create(shadow *models.Shadow) (*models.Shadow, error)
- func (d *DB) CreateApplication(app *specV1.Application) (sql.Result, error)
- func (d *DB) CreateApplicationWithTx(tx *sqlx.Tx, app *specV1.Application) (sql.Result, error)
- func (d *DB) CreateBatch(batch *models.Batch) (sql.Result, error)
- func (d *DB) CreateBatchTx(tx *sqlx.Tx, batch *models.Batch) (sql.Result, error)
- func (d *DB) CreateCallback(callback *models.Callback) (sql.Result, error)
- func (d *DB) CreateCallbackTx(tx *sqlx.Tx, callback *models.Callback) (sql.Result, error)
- func (d DB) CreateCert(cert plugin.Cert) error
- func (d *DB) CreateIndex(namespace string, keyA, keyB common.Resource, valueA, valueB string) (sql.Result, error)
- func (d *DB) CreateIndexTx(tx *sqlx.Tx, namespace string, keyA, keyB common.Resource, ...) (sql.Result, error)
- func (d *DB) CreateProperty(property *models.Property) error
- func (d *DB) CreateRecord(records []models.Record) (sql.Result, error)
- func (d *DB) CreateRecordTx(tx *sqlx.Tx, records []models.Record) (sql.Result, error)
- func (d *DB) CreateShadowTx(tx *sqlx.Tx, shadow *models.Shadow) (sql.Result, error)
- func (d *DB) CreateTask(task *models.Task) (sql.Result, error)
- func (d *DB) CreateTaskTx(tx *sqlx.Tx, task *models.Task) (sql.Result, error)
- func (d *DB) Delete(namespace, name string) error
- func (d *DB) DeleteApplication(name, namespace, version string) (sql.Result, error)
- func (d *DB) DeleteApplicationWithTx(tx *sqlx.Tx, name, namespace, version string) (sql.Result, error)
- func (d *DB) DeleteBatch(name, ns string) (sql.Result, error)
- func (d *DB) DeleteBatchTx(tx *sqlx.Tx, name, ns string) (sql.Result, error)
- func (d *DB) DeleteCallback(name, ns string) (sql.Result, error)
- func (d *DB) DeleteCallbackTx(tx *sqlx.Tx, name, ns string) (sql.Result, error)
- func (d DB) DeleteCert(certId string) error
- func (d *DB) DeleteIndex(namespace string, keyA, byKeyB common.Resource, valueB string) (sql.Result, error)
- func (d *DB) DeleteIndexTx(tx *sqlx.Tx, namespace string, keyA, byKeyB common.Resource, valueB string) (sql.Result, error)
- func (d *DB) DeleteProperty(name string) error
- func (d *DB) DeleteRecord(batchName, recordName, ns string) (sql.Result, error)
- func (d *DB) DeleteRecordTx(tx *sqlx.Tx, batchName, recordName, ns string) (sql.Result, error)
- func (d *DB) DeleteShadowTx(tx *sqlx.Tx, namespace, name string) (sql.Result, error)
- func (d *DB) DeleteTask(traceId string) (sql.Result, error)
- func (d *DB) DeleteTaskTx(tx *sqlx.Tx, traceId string) (sql.Result, error)
- func (d *DB) Exec(tx *sqlx.Tx, sql string, args ...interface{}) (sql.Result, error)
- func (d *DB) Get(namespace, name string) (*models.Shadow, error)
- func (d *DB) GetApplication(name, namespace, version string) (*specV1.Application, error)
- func (d *DB) GetBatch(name, ns string) (*models.Batch, error)
- func (d *DB) GetBatchTx(tx *sqlx.Tx, name, ns string) (*models.Batch, error)
- func (d *DB) GetCallback(name, namespace string) (*models.Callback, error)
- func (d *DB) GetCallbackTx(tx *sqlx.Tx, name, namespace string) (*models.Callback, error)
- func (d DB) GetCert(certId string) (*plugin.Cert, error)
- func (d *DB) GetProperty(name string) (*models.Property, error)
- func (d *DB) GetPropertyValue(name string) (string, error)
- func (d *DB) GetRecord(batchName, recordName, ns string) (*models.Record, error)
- func (d *DB) GetRecordByFingerprint(batchName, ns, value string) (*models.Record, error)
- func (d *DB) GetRecordByFingerprintTx(tx *sqlx.Tx, batchName, ns, value string) (*models.Record, error)
- func (d *DB) GetRecordTx(tx *sqlx.Tx, batchName, recordName, ns string) (*models.Record, error)
- func (d *DB) GetShadowTx(tx *sqlx.Tx, namespace, name string) (*models.Shadow, error)
- func (d *DB) GetTask(traceId string) (*models.Task, error)
- func (d *DB) GetTaskTx(tx *sqlx.Tx, traceId string) (*models.Task, error)
- func (d *DB) List(namespace string, nodeList *models.NodeList) (*models.ShadowList, error)
- func (d *DB) ListApplication(namespace string, filter *models.Filter) ([]specV1.Application, error)
- func (d *DB) ListBatch(ns string, filter *models.Filter) ([]models.Batch, error)
- func (d *DB) ListBatchTx(tx *sqlx.Tx, ns string, filter *models.Filter) ([]models.Batch, error)
- func (d *DB) ListIndex(namespace string, keyA, byKeyB common.Resource, valueB string) ([]string, error)
- func (d *DB) ListIndexTx(tx *sqlx.Tx, namespace string, keyA, byKeyB common.Resource, valueB string) ([]string, error)
- func (d *DB) ListProperty(filter *models.Filter) ([]models.Property, error)
- func (d *DB) ListRecord(batchName, ns string, filter *models.Filter) ([]models.Record, error)
- func (d *DB) ListRecordByBatchTx(tx *sqlx.Tx, batchName, namespace string) ([]models.Record, error)
- func (d *DB) ListRecordTx(tx *sqlx.Tx, batchName, ns string, filter *models.Filter) ([]models.Record, error)
- func (d *DB) ListShadowByNamesTx(tx *sqlx.Tx, namespace string, names []string) ([]entities.Shadow, error)
- func (d *DB) Query(tx *sqlx.Tx, sql string, data interface{}, args ...interface{}) error
- func (d *DB) RefreshIndex(namespace string, keyA, keyB common.Resource, valueA string, valueBs []string) error
- func (d *DB) Transact(handler func(*sqlx.Tx) error) (err error)
- func (d *DB) UpdateApplication(app *specV1.Application, oldVersion string) (sql.Result, error)
- func (d *DB) UpdateApplicationWithTx(tx *sqlx.Tx, app *specV1.Application, oldVersion string) (sql.Result, error)
- func (d *DB) UpdateBatch(batch *models.Batch) (sql.Result, error)
- func (d *DB) UpdateBatchTx(tx *sqlx.Tx, batch *models.Batch) (sql.Result, error)
- func (d *DB) UpdateCallback(callback *models.Callback) (sql.Result, error)
- func (d *DB) UpdateCallbackTx(tx *sqlx.Tx, callback *models.Callback) (sql.Result, error)
- func (d DB) UpdateCert(cert plugin.Cert) error
- func (d *DB) UpdateDesire(shadow *models.Shadow) (*models.Shadow, error)
- func (d *DB) UpdateProperty(property *models.Property) error
- func (d *DB) UpdateRecord(record *models.Record) (sql.Result, error)
- func (d *DB) UpdateRecordTx(tx *sqlx.Tx, record *models.Record) (sql.Result, error)
- func (d *DB) UpdateReport(shadow *models.Shadow) (*models.Shadow, error)
- func (d *DB) UpdateShadowDesireTx(tx *sqlx.Tx, shadow *models.Shadow) (sql.Result, error)
- func (d *DB) UpdateShadowReportTx(tx *sqlx.Tx, shadow *models.Shadow) (sql.Result, error)
- func (d *DB) UpdateTask(task *models.Task) (sql.Result, error)
- func (d *DB) UpdateTaskTx(tx *sqlx.Tx, task *models.Task) (sql.Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloudConfig ¶
type CloudConfig struct { Database struct { Type string `yaml:"type" json:"type" validate:"nonzero"` URL string `yaml:"url" json:"url" validate:"nonzero"` MaxConns int `yaml:"maxConns" json:"maxConns" default:20` MaxIdleConns int `yaml:"maxIdleConns" json:"maxIdleConns" default:5` ConnMaxLifetime int `yaml:"connMaxLifetime" json:"connMaxLifetime" default:150` } `yaml:"database" json:"database" default:"{}"` }
CloudConfig baetyl-cloud config
type DB ¶ added in v2.1.1
type DB struct {
// contains filtered or unexported fields
}
DBStorage
func (*DB) CountApplication ¶ added in v2.1.1
func (*DB) CountBatchByCallback ¶
func (*DB) CountBatchByCallbackTx ¶
func (DB) CountCertByParentId ¶ added in v2.1.1
func (*DB) CountRecord ¶
func (*DB) CountRecordTx ¶
func (*DB) CreateApplication ¶ added in v2.1.1
func (*DB) CreateApplicationWithTx ¶ added in v2.1.1
func (*DB) CreateBatchTx ¶
func (*DB) CreateCallback ¶
func (*DB) CreateCallbackTx ¶
func (*DB) CreateIndex ¶ added in v2.1.1
func (*DB) CreateIndexTx ¶ added in v2.1.1
func (*DB) CreateProperty ¶ added in v2.1.1
func (*DB) CreateRecordTx ¶
func (*DB) CreateShadowTx ¶ added in v2.1.1
func (*DB) CreateTask ¶ added in v2.1.1
func (*DB) CreateTaskTx ¶ added in v2.1.1
func (*DB) DeleteApplication ¶ added in v2.1.1
func (*DB) DeleteApplicationWithTx ¶ added in v2.1.1
func (*DB) DeleteBatchTx ¶
func (*DB) DeleteCallbackTx ¶
func (DB) DeleteCert ¶ added in v2.1.1
func (*DB) DeleteIndex ¶ added in v2.1.1
func (*DB) DeleteIndexTx ¶ added in v2.1.1
func (*DB) DeleteProperty ¶ added in v2.1.1
func (*DB) DeleteRecord ¶
func (*DB) DeleteRecordTx ¶
func (*DB) DeleteShadowTx ¶ added in v2.1.1
func (*DB) DeleteTaskTx ¶ added in v2.1.1
func (*DB) GetApplication ¶ added in v2.1.1
func (d *DB) GetApplication(name, namespace, version string) (*specV1.Application, error)
func (*DB) GetBatchTx ¶
func (*DB) GetCallbackTx ¶
func (*DB) GetProperty ¶ added in v2.1.1
func (*DB) GetPropertyValue ¶ added in v2.1.1
func (*DB) GetRecordByFingerprint ¶
func (*DB) GetRecordByFingerprintTx ¶
func (*DB) GetRecordTx ¶
func (*DB) GetShadowTx ¶ added in v2.1.1
func (*DB) ListApplication ¶ added in v2.1.1
func (*DB) ListBatchTx ¶
func (*DB) ListIndexTx ¶ added in v2.1.1
func (*DB) ListProperty ¶ added in v2.1.1
func (*DB) ListRecord ¶
func (*DB) ListRecordByBatchTx ¶
func (*DB) ListRecordTx ¶
func (*DB) ListShadowByNamesTx ¶ added in v2.1.1
func (*DB) RefreshIndex ¶ added in v2.1.1
func (*DB) UpdateApplication ¶ added in v2.1.1
func (*DB) UpdateApplicationWithTx ¶ added in v2.1.1
func (*DB) UpdateBatchTx ¶
func (*DB) UpdateCallback ¶
func (*DB) UpdateCallbackTx ¶
func (*DB) UpdateDesire ¶ added in v2.1.1
func (*DB) UpdateProperty ¶ added in v2.1.1
func (*DB) UpdateRecordTx ¶
func (*DB) UpdateReport ¶ added in v2.1.1
func (*DB) UpdateShadowDesireTx ¶ added in v2.1.1
func (*DB) UpdateShadowReportTx ¶ added in v2.1.1
func (*DB) UpdateTask ¶ added in v2.1.1
Source Files ¶
Click to show internal directories.
Click to hide internal directories.