Documentation
¶
Index ¶
- type AccessToken
- func (t *AccessToken) AllAccessTokens(tx *sqlx.Tx) ([]*AccessTokenRow, error)
- func (t *AccessToken) AllAccessTokensByClusterID(tx *sqlx.Tx, clusterID int64) ([]*AccessTokenRow, error)
- func (t *AccessToken) Create(tx *sqlx.Tx, userID, clusterID int64, level string) (*AccessTokenRow, error)
- func (t *AccessToken) GetByAccessToken(tx *sqlx.Tx, token string) (*AccessTokenRow, error)
- func (t *AccessToken) GetByClusterID(tx *sqlx.Tx, clusterID int64) (*AccessTokenRow, error)
- func (t *AccessToken) GetByID(tx *sqlx.Tx, id int64) (*AccessTokenRow, error)
- func (t *AccessToken) GetByUserId(tx *sqlx.Tx, userID int64) (*AccessTokenRow, error)
- type AccessTokenRow
- type Base
- func (b *Base) DeleteById(tx *sqlx.Tx, id int64) (sql.Result, error)
- func (b *Base) DeleteFromTable(tx *sqlx.Tx, where string) (sql.Result, error)
- func (b *Base) InsertIntoTable(tx *sqlx.Tx, data map[string]interface{}) (sql.Result, error)
- func (b *Base) UpdateByAccessTokenAndSavedQuery(tx *sqlx.Tx, data map[string]interface{}, accessTokenRow *AccessTokenRow, ...) (sql.Result, error)
- func (b *Base) UpdateByID(tx *sqlx.Tx, data map[string]interface{}, id int64) (sql.Result, error)
- func (b *Base) UpdateById(tx *sqlx.Tx, data map[string]interface{}, id int64) (sql.Result, error)
- func (b *Base) UpdateByKeyValueString(tx *sqlx.Tx, data map[string]interface{}, key, value string) (sql.Result, error)
- func (b *Base) UpdateFromTable(tx *sqlx.Tx, data map[string]interface{}, where string) (sql.Result, error)
- type Cluster
- type ClusterRow
- type Executor
- func (e *Executor) AllByClusterID(tx *sqlx.Tx, clusterID int64) ([]*ExecutorRow, error)
- func (e *Executor) CreateOrUpdate(tx *sqlx.Tx, clusterID int64, hostname string, data []byte) (*ExecutorRow, error)
- func (e *Executor) GetByClusterIDAndHostname(tx *sqlx.Tx, clusterID int64, hostname string) (*ExecutorRow, error)
- func (e *Executor) UpdateByClusterIDAndHostname(tx *sqlx.Tx, clusterID int64, hostname string, data []byte) (*ExecutorRow, error)
- type ExecutorRow
- type Host
- func (h *Host) AllByAccessTokenId(tx *sqlx.Tx, accessTokenId int64) ([]*HostRow, error)
- func (h *Host) AllByAccessTokenIdAndQuery(tx *sqlx.Tx, accessTokenId int64, resourcedQuery string) ([]*HostRow, error)
- func (h *Host) CreateOrUpdate(tx *sqlx.Tx, accessTokenId int64, jsonData []byte) (*HostRow, error)
- func (h *Host) GetByID(tx *sqlx.Tx, id int64) (*HostRow, error)
- func (h *Host) GetByName(tx *sqlx.Tx, name string) (*HostRow, error)
- type HostRow
- type InsertResult
- type Metadata
- func (metadata *Metadata) AllByClusterID(tx *sqlx.Tx, clusterID int64) ([]*MetadataRow, error)
- func (metadata *Metadata) CreateOrUpdate(tx *sqlx.Tx, clusterID int64, key string, data []byte) (*MetadataRow, error)
- func (metadata *Metadata) GetByClusterIDAndKey(tx *sqlx.Tx, clusterID int64, key string) (*MetadataRow, error)
- func (metadata *Metadata) UpdateByClusterIDAndKey(tx *sqlx.Tx, clusterID int64, key string, data []byte) (*MetadataRow, error)
- type MetadataRow
- type ResourcedPayload
- type SavedQuery
- func (sq *SavedQuery) AllByAccessToken(tx *sqlx.Tx, accessTokenRow *AccessTokenRow) ([]*SavedQueryRow, error)
- func (sq *SavedQuery) CreateOrUpdate(tx *sqlx.Tx, accessTokenID int64, savedQuery string) (*SavedQueryRow, error)
- func (sq *SavedQuery) DeleteByID(tx *sqlx.Tx, id int64) error
- func (sq *SavedQuery) GetByAccessTokenAndQuery(tx *sqlx.Tx, accessTokenRow *AccessTokenRow, savedQuery string) (*SavedQueryRow, error)
- func (sq *SavedQuery) GetByID(tx *sqlx.Tx, id int64) (*SavedQueryRow, error)
- type SavedQueryRow
- type Task
- func (task *Task) AllByAccessToken(tx *sqlx.Tx, accessTokenRow *AccessTokenRow) ([]*TaskRow, error)
- func (task *Task) Create(tx *sqlx.Tx, accessTokenID int64, savedQuery, cron string) (*TaskRow, error)
- func (task *Task) DeleteByID(tx *sqlx.Tx, id int64) error
- func (task *Task) GetByAccessTokenQueryAndCron(tx *sqlx.Tx, accessTokenRow *AccessTokenRow, savedQuery, cron string) (*TaskRow, error)
- func (task *Task) GetByID(tx *sqlx.Tx, id int64) (*TaskRow, error)
- type TaskRow
- type User
- func (u *User) AllUsers(tx *sqlx.Tx) ([]*UserRow, error)
- func (u *User) GetByEmail(tx *sqlx.Tx, email string) (*UserRow, error)
- func (u *User) GetByID(tx *sqlx.Tx, id int64) (*UserRow, error)
- func (u *User) GetUserByEmailAndPassword(tx *sqlx.Tx, email, password string) (*UserRow, error)
- func (u *User) Signup(tx *sqlx.Tx, email, password, passwordAgain string) (*UserRow, error)
- func (u *User) UpdateEmailAndPasswordById(tx *sqlx.Tx, userId int64, email, password, passwordAgain string) (*UserRow, error)
- type UserRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessToken ¶
type AccessToken struct {
Base
}
func NewAccessToken ¶
func NewAccessToken(db *sqlx.DB) *AccessToken
func (*AccessToken) AllAccessTokens ¶
func (t *AccessToken) AllAccessTokens(tx *sqlx.Tx) ([]*AccessTokenRow, error)
AllAccessTokens returns all access tokens.
func (*AccessToken) AllAccessTokensByClusterID ¶
func (t *AccessToken) AllAccessTokensByClusterID(tx *sqlx.Tx, clusterID int64) ([]*AccessTokenRow, error)
AllAccessTokens returns all access tokens by cluster id.
func (*AccessToken) Create ¶
func (t *AccessToken) Create(tx *sqlx.Tx, userID, clusterID int64, level string) (*AccessTokenRow, error)
func (*AccessToken) GetByAccessToken ¶
func (t *AccessToken) GetByAccessToken(tx *sqlx.Tx, token string) (*AccessTokenRow, error)
GetByAccessToken returns one record by token.
func (*AccessToken) GetByClusterID ¶
func (t *AccessToken) GetByClusterID(tx *sqlx.Tx, clusterID int64) (*AccessTokenRow, error)
GetByClusterID returns one record by cluster_id.
func (*AccessToken) GetByID ¶
func (t *AccessToken) GetByID(tx *sqlx.Tx, id int64) (*AccessTokenRow, error)
GetByID returns one record by id.
func (*AccessToken) GetByUserId ¶
func (t *AccessToken) GetByUserId(tx *sqlx.Tx, userID int64) (*AccessTokenRow, error)
GetByUserId returns one record by user_id.
type AccessTokenRow ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
func (*Base) DeleteFromTable ¶
func (*Base) InsertIntoTable ¶
func (*Base) UpdateByAccessTokenAndSavedQuery ¶
func (*Base) UpdateByID ¶
func (*Base) UpdateById ¶
func (*Base) UpdateByKeyValueString ¶
type Cluster ¶
type Cluster struct {
Base
}
func NewCluster ¶
func (*Cluster) AllClustersByUserID ¶
AllClustersByUserID returns all clusters rows.
type ClusterRow ¶
type Executor ¶
type Executor struct {
Base
}
func NewExecutor ¶
func (*Executor) AllByClusterID ¶
AllByClusterID returns all executor rows by cluster id.
func (*Executor) CreateOrUpdate ¶
func (e *Executor) CreateOrUpdate(tx *sqlx.Tx, clusterID int64, hostname string, data []byte) (*ExecutorRow, error)
CreateOrUpdate performs insert/update for one executor data.
func (*Executor) GetByClusterIDAndHostname ¶
func (e *Executor) GetByClusterIDAndHostname(tx *sqlx.Tx, clusterID int64, hostname string) (*ExecutorRow, error)
GetByClusterIDAndHostname returns record by cluster_id and hostname.
func (*Executor) UpdateByClusterIDAndHostname ¶
func (e *Executor) UpdateByClusterIDAndHostname(tx *sqlx.Tx, clusterID int64, hostname string, data []byte) (*ExecutorRow, error)
UpdateByClusterIDAndHostname updates record by cluster_id.
type ExecutorRow ¶
type ExecutorRow struct {
ClusterID int64 `db:"cluster_id" json:"-"`
Hostname string `db:"hostname"`
Data sqlx_types.JsonText `db:"data"`
}
func (*ExecutorRow) DataString ¶
func (executorRow *ExecutorRow) DataString() string
type Host ¶
type Host struct {
Base
}
func (*Host) AllByAccessTokenId ¶
AllByAccessTokenId returns all user rows.
func (*Host) AllByAccessTokenIdAndQuery ¶
func (h *Host) AllByAccessTokenIdAndQuery(tx *sqlx.Tx, accessTokenId int64, resourcedQuery string) ([]*HostRow, error)
AllByAccessTokenIdAndQuery returns all user rows by resourced query.
func (*Host) CreateOrUpdate ¶
CreateOrUpdate performs insert/update for one host data.
type HostRow ¶
type HostRow struct {
ID int64 `db:"id" json:"-"`
AccessTokenID int64 `db:"access_token_id" json:"-"`
Name string `db:"name"`
Updated time.Time `db:"updated"`
Tags sqlx_types.JsonText `db:"tags"`
Data sqlx_types.JsonText `db:"data"`
}
func (*HostRow) DataAsFlatKeyValue ¶
func (*HostRow) StringTags ¶
type InsertResult ¶
type InsertResult struct {
// contains filtered or unexported fields
}
func (*InsertResult) LastInsertId ¶
func (ir *InsertResult) LastInsertId() (int64, error)
func (*InsertResult) RowsAffected ¶
func (ir *InsertResult) RowsAffected() (int64, error)
type Metadata ¶
type Metadata struct {
Base
}
func NewMetadata ¶
func (*Metadata) AllByClusterID ¶
AllByClusterID returns all user rows.
func (*Metadata) CreateOrUpdate ¶
func (metadata *Metadata) CreateOrUpdate(tx *sqlx.Tx, clusterID int64, key string, data []byte) (*MetadataRow, error)
CreateOrUpdate performs insert/update for one metadata data.
func (*Metadata) GetByClusterIDAndKey ¶
func (metadata *Metadata) GetByClusterIDAndKey(tx *sqlx.Tx, clusterID int64, key string) (*MetadataRow, error)
GetByClusterIDAndKey returns record by cluster_id and key.
func (*Metadata) UpdateByClusterIDAndKey ¶
func (metadata *Metadata) UpdateByClusterIDAndKey(tx *sqlx.Tx, clusterID int64, key string, data []byte) (*MetadataRow, error)
UpdateByClusterIDAndKey updates record by cluster_id and key.
type MetadataRow ¶
type MetadataRow struct {
ClusterID int64 `db:"cluster_id" json:"-"`
Key string `db:"key"`
Data sqlx_types.JsonText `db:"data"`
}
func (*MetadataRow) DataString ¶
func (metadataRow *MetadataRow) DataString() string
type ResourcedPayload ¶
type SavedQuery ¶
type SavedQuery struct {
Base
}
func NewSavedQuery ¶
func NewSavedQuery(db *sqlx.DB) *SavedQuery
func (*SavedQuery) AllByAccessToken ¶
func (sq *SavedQuery) AllByAccessToken(tx *sqlx.Tx, accessTokenRow *AccessTokenRow) ([]*SavedQueryRow, error)
AllByAccessToken returns all saved_query rows.
func (*SavedQuery) CreateOrUpdate ¶
func (sq *SavedQuery) CreateOrUpdate(tx *sqlx.Tx, accessTokenID int64, savedQuery string) (*SavedQueryRow, error)
CreateOrUpdate performs insert/update for one savedQuery data.
func (*SavedQuery) DeleteByID ¶
func (sq *SavedQuery) DeleteByID(tx *sqlx.Tx, id int64) error
DeleteByID deletes record by id.
func (*SavedQuery) GetByAccessTokenAndQuery ¶
func (sq *SavedQuery) GetByAccessTokenAndQuery(tx *sqlx.Tx, accessTokenRow *AccessTokenRow, savedQuery string) (*SavedQueryRow, error)
GetByAccessTokenAndQuery returns record by savedQuery.
func (*SavedQuery) GetByID ¶
func (sq *SavedQuery) GetByID(tx *sqlx.Tx, id int64) (*SavedQueryRow, error)
GetByID returns record by id.
type SavedQueryRow ¶
type Task ¶
type Task struct {
Base
}
func (*Task) AllByAccessToken ¶
AllByAccessToken returns all tasks_cron rows.
func (*Task) Create ¶
func (task *Task) Create(tx *sqlx.Tx, accessTokenID int64, savedQuery, cron string) (*TaskRow, error)
Create performs insert for one task data.
func (*Task) DeleteByID ¶
DeleteByID deletes record by id.
func (*Task) GetByAccessTokenQueryAndCron ¶
func (task *Task) GetByAccessTokenQueryAndCron(tx *sqlx.Tx, accessTokenRow *AccessTokenRow, savedQuery, cron string) (*TaskRow, error)
GetByAccessTokenQueryAndCron returns record by token, query and cron.
type User ¶
type User struct {
Base
}
func (*User) GetByEmail ¶
GetByEmail returns record by email.
func (*User) GetUserByEmailAndPassword ¶
GetByEmail returns record by email but checks password first.