Documentation
¶
Index ¶
- type AccessToken
- func (t *AccessToken) AllAccessTokens(tx *sqlx.Tx) ([]*AccessTokenRow, error)
- func (t *AccessToken) Create(tx *sqlx.Tx, userId int64, level string) (*AccessTokenRow, error)
- func (t *AccessToken) GetByAccessToken(tx *sqlx.Tx, token string) (*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) 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 Host
- func (h *Host) AllHostsByAccessTokenId(tx *sqlx.Tx, accessTokenId int64) ([]*HostRow, error)
- func (h *Host) AllHostsByAccessTokenIdAndQuery(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 ResourcedPayload
- type User
- func (u *User) AllUsers(tx *sqlx.Tx) ([]*UserRow, error)
- func (u *User) CreateAccessTokenRow(tx *sqlx.Tx, userId int64, level string) (*AccessTokenRow, 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 user rows.
func (*AccessToken) Create ¶
func (t *AccessToken) Create(tx *sqlx.Tx, userId 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) 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) UpdateById ¶
func (*Base) UpdateByKeyValueString ¶
type Host ¶
type Host struct {
Base
}
func (*Host) AllHostsByAccessTokenId ¶
AllHostsByAccessTokenId returns all user rows.
func (*Host) AllHostsByAccessTokenIdAndQuery ¶
func (h *Host) AllHostsByAccessTokenIdAndQuery(tx *sqlx.Tx, accessTokenId int64, resourcedQuery string) ([]*HostRow, error)
AllHostsByAccessTokenIdAndQuery 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"`
AccessTokenID int64 `db:"access_token_id"`
Name string `db:"name"`
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 ResourcedPayload ¶
type User ¶
type User struct {
Base
}
func (*User) CreateAccessTokenRow ¶
func (u *User) CreateAccessTokenRow(tx *sqlx.Tx, userId int64, level string) (*AccessTokenRow, error)
CreateAccessTokenRow create a new token for a user.
func (*User) GetByEmail ¶
GetByEmail returns record by email.
func (*User) GetUserByEmailAndPassword ¶
GetByEmail returns record by email but checks password first.
Click to show internal directories.
Click to hide internal directories.