models

package
v0.0.0-...-fba4c40 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 2 Imported by: 1,383

Documentation

Index

Constants

View Source
const (
	// JobPending ...
	JobPending string = "pending"
	// JobRunning ...
	JobRunning string = "running"
	// JobError ...
	JobError string = "error"
	// JobStopped ...
	JobStopped string = "stopped"
	// JobFinished ...
	JobFinished string = "finished"
	// JobCanceled ...
	JobCanceled string = "canceled"
	// JobRetrying indicate the job needs to be retried, it will be scheduled to the end of job queue by statemachine after an interval.
	JobRetrying string = "retrying"
	// JobContinue is the status returned by statehandler to tell statemachine to move to next possible state based on trasition table.
	JobContinue string = "_continue"
	// JobScheduled ...
	JobScheduled string = "scheduled"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthModel

type AuthModel struct {
	Principal string
	Password  string
}

AuthModel holds information used to authenticate.

type Database

type Database struct {
	Type       string      `json:"type"`
	PostGreSQL *PostGreSQL `json:"postgresql,omitempty"`
}

Database ...

type Metric

type Metric struct {
	Enabled bool
	Port    int
	Path    string
}

Metric wraps the configurations to access UAA service

type OIDCUser

type OIDCUser struct {
	ID     int64 `orm:"pk;auto;column(id)" json:"id"`
	UserID int   `orm:"column(user_id)" json:"user_id"`
	// encrypted secret
	Secret string `orm:"column(secret)" json:"-"`
	// secret in plain text
	PlainSecret  string    `orm:"-" json:"secret"`
	SubIss       string    `orm:"column(subiss)" json:"subiss"`
	Token        string    `orm:"column(token)" json:"-"`
	CreationTime time.Time `orm:"column(creation_time);auto_now_add" json:"creation_time"`
	UpdateTime   time.Time `orm:"column(update_time);auto_now" json:"update_time"`
}

OIDCUser ...

func (*OIDCUser) TableName

func (o *OIDCUser) TableName() string

TableName ...

type PostGreSQL

type PostGreSQL struct {
	Host            string        `json:"host"`
	Port            int           `json:"port"`
	Username        string        `json:"username"`
	Password        string        `json:"password,omitempty"`
	Database        string        `json:"database"`
	SSLMode         string        `json:"sslmode"`
	MaxIdleConns    int           `json:"max_idle_conns"`
	MaxOpenConns    int           `json:"max_open_conns"`
	ConnMaxLifetime time.Duration `json:"conn_max_lifetime"`
	ConnMaxIdleTime time.Duration `json:"conn_max_idle_time"`
}

PostGreSQL ...

type ResourceActions

type ResourceActions struct {
	Name    string   `json:"name"`
	Actions []string `json:"actions"`
}

ResourceActions ...

type Role

type Role struct {
	RoleID   int    `orm:"pk;auto;column(role_id)" json:"role_id"`
	RoleCode string `orm:"column(role_code)" json:"role_code"`
	Name     string `orm:"column(name)" json:"role_name"`
	RoleMask int    `orm:"column(role_mask)" json:"role_mask"`
}

Role holds the details of a role.

type SQLite

type SQLite struct {
	File string `json:"file"`
}

SQLite ...

type Token

type Token struct {
	Token       string `json:"token"`
	AccessToken string `json:"access_token"` // the token returned by azure container registry is called "access_token"
	ExpiresIn   int    `json:"expires_in"`
	IssuedAt    string `json:"issued_at"`
}

Token represents the json returned by registry token service

func (*Token) GetToken

func (t *Token) GetToken() string

GetToken returns the content of the token

type UAASettings

type UAASettings struct {
	Endpoint     string
	ClientID     string
	ClientSecret string
	VerifyCert   bool
}

UAASettings wraps the configuraations to access UAA service

type User

type User struct {
	UserID          int    `json:"user_id"`
	Username        string `json:"username" sort:"default"`
	Email           string `json:"email"`
	Password        string `json:"password"`
	PasswordVersion string `json:"password_version"`
	Realname        string `json:"realname"`
	Comment         string `json:"comment"`
	Deleted         bool   `json:"deleted"`
	Rolename        string `json:"role_name"`
	Role            int    `json:"role_id"`
	SysAdminFlag    bool   `json:"sysadmin_flag"`
	// AdminRoleInAuth to store the admin privilege granted by external authentication provider
	AdminRoleInAuth bool      `json:"admin_role_in_auth"`
	ResetUUID       string    `json:"reset_uuid"`
	Salt            string    `json:"-"`
	CreationTime    time.Time `json:"creation_time"`
	UpdateTime      time.Time `json:"update_time"`
	GroupIDs        []int     `json:"-"`
	OIDCUserMeta    *OIDCUser `json:"oidc_user_meta,omitempty"`
}

User holds the details of a user.

type Users

type Users []*User

func (Users) MapByUserID

func (users Users) MapByUserID() map[int]*User

MapByUserID returns map which key is UserID of the user and value is the user itself

Jump to

Keyboard shortcuts

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