models

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: AGPL-3.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// PENDING: the job is created but not started
	PENDING taksStatus = iota
	RUNNING
	FAILED
	FINISH
)

Variables

This section is empty.

Functions

func GetResult

func GetResult(s cache.Storage, key string) (result []byte, ok bool)

func SetResult

func SetResult(s cache.Storage, result []byte, key string, ttk int) error

func TaksStatus added in v0.1.4

func TaksStatus(i int) string

Types

type ApiPath

type ApiPath struct {
	ID  int    `json:"id"`
	API string `json:"api"`
	RGX string `json:"regex"`
}

func GetApiPath

func GetApiPath(s cache.Storage, c *Configuration) (apiPath []ApiPath, err error)

type Configuration

type Configuration struct {
	Listen          string             `json:"listen"`
	EzbDB           string             `json:"ezb_db"`
	Logger          confmanager.Logger `json:"logger"`
	CacheL1         int                `json:"cacheL1"`
	PrivateKey      string             `json:"privatekey"`
	PublicCert      string             `json:"publiccert"`
	CaCert          string             `json:"cacert"`
	ServiceName     string             `json:"servicename"`
	ServiceFullName string             `json:"servicefullname"`
	EzbPki          string             `json:"ezb_pki"`
	SAN             []string           `json:"san"`
}

type EzbAccounts

type EzbAccounts struct {
	ID          int       `json:"id"`
	Name        string    `json:"name"`
	Enable      bool      `json:"enable"`
	Isadmin     bool      `json:"isadmin"`
	Comment     string    `json:"comment"`
	LastRequest time.Time `json:"lastrequest"`
	Type        string    `json:"type"`
	Real        string    `json:"real"`
	Email       string    `json:"email"`
	EzbStasID   int       `json:"stasid"`
	STA         EzbStas   `json:"sta"`
}

func GetAccount

func GetAccount(s cache.Storage, c *Configuration, userID string) (account EzbAccounts, err error)

type EzbActions

type EzbActions struct {
	ID          int            `json:"id"`
	Name        string         `json:"name"`
	Enable      bool           `json:"enable"  `
	Comment     string         `json:"comment"`
	LastRequest time.Time      `json:"lastrequest"`
	Tags        []*EzbTags     `json:"tags"`
	Jobs        EzbJobs        `json:"jobs"`
	Workers     []EzbWorkers   `json:"workers"`
	Path        string         `json:"path"`
	Query       string         `json:"query"`
	Body        string         `json:"body"`
	Constant    string         `json:"constant"`
	Deprecated  int            `json:"deprecated"`
	Anonymous   bool           `json:"anonymous"`
	Controllers EzbControllers `json:"controllers"`
	Polling     bool           `gorm:"not null;default:'0'" json:"polling"`
}

func GetAction

func GetAction(s cache.Storage, c *Configuration, actionID int) (action EzbActions, err error)

type EzbControllers

type EzbControllers struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Enable  bool   `json:"enable"  `
	Comment string `json:"comment"`
	Version int    `json:"version"`
}

type EzbJobs

type EzbJobs struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	Enable   bool   `json:"enable"`
	Comment  string `json:"comment"`
	Checksum string `json:"checksum"`
	Path     string `json:"path"`
	Cache    int    `json:"cache"`
	Output   string `json:"output"`
}

type EzbLogs

type EzbLogs struct {
	ID         int       `json:"id"`
	Date       time.Time `json:"date"`
	Status     string    `json:"status"`
	Ipaddr     string    `json:"ipaddr"`
	Token      string    `json:"token"`
	Controller string    `json:"controller"`
	Action     string    `json:"action"`
	URL        string    `json:"url"`
	Bastion    string    `json:"bastion"`
	Worker     string    `json:"worker"`
	Issuer     string    `json:"issuer"`
	Xtrack     string    `json:"xtrack"`
	Deprecated bool      `json:"deprecated"`
	Methode    string    `json:"methode"`
	Duration   int64     `json:"duration"`
	Size       int       `json:"size"`
	Error      string    `json:"error"`
	Account    string    `json:"account"`
}

type EzbParamMeta added in v0.1.4

type EzbParamMeta struct {
	Job EzbJobs `json:"job"`
}

type EzbParams added in v0.1.4

type EzbParams struct {
	Data map[string]string `json:"data"`
	Meta EzbParamMeta      `json:"meta"`
}

type EzbStas

type EzbStas struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	Enable   bool   `json:"enable"`
	Type     int    `json:"type"` // 0:internal  1:AD  2:oAuth2
	Comment  string `json:"comment"`
	EndPoint string `json:"authorization_endpoint"`
	Issuer   string `json:"issuer"`
	Default  bool   `json:"default"`
}

func GetStas

func GetStas(s cache.Storage, c *Configuration) (stas []EzbStas, err error)

type EzbTags

type EzbTags struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Comment string `json:"comment"`
}

type EzbTasks added in v0.1.4

type EzbTasks struct {
	UUID       string    `json:"uuid"`
	CreateDate time.Time `json:"createddate"`
	UpdateDate time.Time `json:"updatedate"`
	Status     string    `json:"status"`
	// TokenID    string    `json:"tokenid"`
	// PID        int       `json:"pid"`
	// Parameters string    `json:"parameters"`
	StatusURL string `json:"statusurl"`
	LogURL    string `json:"logurl"`
	ResultURL string `json:"resulturl"`
}

type EzbWorkers

type EzbWorkers struct {
	ID          int       `json:"id"`
	Name        string    `json:"name"`
	Enable      bool      `json:"enable"`
	Comment     string    `json:"comment"`
	Fqdn        string    `json:"fqdn"`
	Register    time.Time `json:"register"`
	LastRequest time.Time `json:"lastrequest"`
	Request     int       `json:"request"`
}

func GetWorkers

func GetWorkers(s cache.Storage, c *Configuration) (workers []EzbWorkers, err error)

type RestQuery

type RestQuery struct {
	Controller string
	Action     string
	Site       string
	Query      map[string][]string
}

type User

type User struct {
	User       string   `json:"user"`
	UserSid    string   `json:"userSid"`
	UserGroups []string `json:"userGroups"`
	Signkey    string   `json:"sign_key"`
}

type ViewApi

type ViewApi struct {
	Account   string `json:"account"`
	Accountid int    `json:"accountid"`
	Ctrl      string `json:"ctrl"`
	Ctrlid    int    `json:"ctrlid"`
	Ctrlver   int    `json:"ctrlver"`
	Action    string `json:"action"`
	Actionid  int    `json:"actionid"`
	Job       string `json:"job"`
	Jobid     int    `json:"jobid"`
	Access    string `json:"access"`
}

func GetViewApi

func GetViewApi(s cache.Storage, c *Configuration, token, xtrack string) ([]ViewApi, error)

Jump to

Keyboard shortcuts

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