models

package
v2.1.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEmptyApps

func BuildEmptyApps() map[string]interface{}

func EqualConfig

func EqualConfig(config1, config2 *specV1.Configuration) bool

Types

type Activation

type Activation struct {
	FingerprintValue string            `json:"fingerprintValue,omitempty" db:"fingerprint_value"`
	PenetrateData    map[string]string `json:"penetrateData,omitempty" db:"penetrate_data"`
}

type AltNames

type AltNames struct {
	DNSNames []string   `json:"dnsNames,omitempty"`
	IPs      []net.IP   `json:"ips,omitempty"`
	Emails   []string   `json:"emails,omitempty"`
	URIs     []*url.URL `json:"uris,omitempty"`
}

AltNames contains the domain names and IP addresses that will be added to the API Server's x509 certificate SubAltNames field. The values will be passed directly to the x509.Certificate object.

type AppItem

type AppItem struct {
	Name              string            `json:"name,omitempty" validate:"omitempty,resourceName"`
	Type              string            `json:"type,omitempty" default:"container"`
	Labels            map[string]string `json:"labels,omitempty"`
	Selector          string            `json:"selector"`
	Version           string            `json:"version,omitempty"`
	Namespace         string            `json:"namespace,omitempty"`
	CreationTimestamp time.Time         `json:"createTime,omitempty"`
	Description       string            `json:"description,omitempty"`
	System            bool              `json:"system,omitempty"`
}

type ApplicationList

type ApplicationList struct {
	Total       int          `json:"total"`
	ListOptions *ListOptions `json:"listOptions"`
	Items       []AppItem    `json:"items"`
}

ApplicationList app List

type ApplicationView

type ApplicationView struct {
	Name              string            `json:"name,omitempty" validate:"resourceName,nonBaetyl"`
	Type              string            `json:"type,omitempty" default:"container"`
	Labels            map[string]string `json:"labels,omitempty"`
	Namespace         string            `json:"namespace,omitempty"`
	CreationTimestamp time.Time         `json:"createTime,omitempty"`
	Version           string            `json:"version,omitempty"`
	Selector          string            `json:"selector,omitempty"`
	Services          []specV1.Service  `json:"services,omitempty"`
	Volumes           []VolumeView      `json:"volumes,omitempty"`
	Description       string            `json:"description,omitempty"`
	System            bool              `json:"system,omitempty"`
	Registries        []RegistryView    `json:"registries,omitempty"`
}

type Batch

type Batch struct {
	Name            string            `json:"name,omitempty" validate:"omitempty,resourceName"`
	Namespace       string            `json:"namespace,omitempty"`
	Description     string            `json:"description,omitempty"`
	QuotaNum        int               `json:"quotaNum,omitempty"`
	EnableWhitelist int               `json:"enableWhitelist,omitempty"`
	SecurityType    common.Security   `json:"securityType,omitempty"`
	SecurityKey     string            `json:"securityKey,omitempty"`
	CallbackName    string            `json:"callbackName,omitempty"`
	Labels          map[string]string `json:"labels,omitempty" validate:"omitempty,validLabels"`
	Fingerprint     Fingerprint       `json:"fingerprint,omitempty"`
	CreateTime      time.Time         `json:"createTime,omitempty"`
	UpdateTime      time.Time         `json:"updateTime,omitempty"`
}

type Bucket

type Bucket struct {
	Name         string    `json:"name,omitempty"`
	CreationDate time.Time `json:"createTime,omitempty"`
}

type BucketsView

type BucketsView struct {
	Buckets []Bucket `json:"buckets"`
}

type Callback

type Callback struct {
	Name        string            `json:"name,omitempty" validate:"omitempty,resourceName"`
	Namespace   string            `json:"namespace,omitempty"`
	Method      string            `json:"method,omitempty" binding:"required"`
	Url         string            `json:"url,omitempty" binding:"required"`
	Params      map[string]string `json:"params,omitempty"`
	Header      map[string]string `json:"header,omitempty"`
	Body        map[string]string `json:"body,omitempty"`
	Description string            `json:"description,omitempty"`
	CreateTime  time.Time         `json:"createTime,omitempty"`
	UpdateTime  time.Time         `json:"updateTime,omitempty"`
}

type CertStorage

type CertStorage struct {
	CertName string
	KeyName  string
}

CertStorage contains certName and keyName which can be used to storage certificate and private key pem data to secret.

type Certificate

type Certificate struct {
	Name               string              `json:"name,omitempty" validate:"omitempty,resourceName,nonBaetyl"`
	Namespace          string              `json:"namespace,omitempty"`
	SignatureAlgorithm string              `json:"signatureAlgorithm,omitempty"`
	EffectiveTime      string              `json:"effectiveTime,omitempty"`
	ExpiredTime        string              `json:"expiredTime,omitempty"`
	SerialNumber       string              `json:"serialNumber,omitempty"`
	Issuer             string              `json:"issuer,omitempty"`
	FingerPrint        string              `json:"fingerPrint,omitempty"`
	Data               CertificateDataItem `json:"data,omitempty"`
	CreationTimestamp  time.Time           `json:"createTime,omitempty"`
	UpdateTimestamp    time.Time           `json:"updateTime,omitempty"`
	Description        string              `json:"description"`
	Version            string              `json:"version,omitempty"`
}

Certificate Certificate

func FromSecretToCertificate

func FromSecretToCertificate(s *specV1.Secret) *Certificate

func (*Certificate) Equal

func (r *Certificate) Equal(target *Certificate) bool

func (*Certificate) ParseCertInfo

func (r *Certificate) ParseCertInfo() error

func (*Certificate) ToSecret

func (r *Certificate) ToSecret() *specV1.Secret

type CertificateDataItem

type CertificateDataItem struct {
	Key         string `json:"key,omitempty"`
	Certificate string `json:"certificate,omitempty"`
}

type CertificateList

type CertificateList struct {
	Total       int           `json:"total"`
	ListOptions *ListOptions  `json:"listOptions"`
	Items       []Certificate `json:"items"`
}

CertificateList Certificate List

func FromSecretListToCertificateList

func FromSecretListToCertificateList(s *SecretList) *CertificateList

type ConfigDataItem

type ConfigDataItem struct {
	Key   string            `json:"key,omitempty" validate:"required,validConfigKeys"`
	Value map[string]string `json:"value,omitempty"`
}

type ConfigFunctionItem

type ConfigFunctionItem struct {
	ConfigObjectItem `json:",inline"`
	Function         string `json:"function,omitempty"`
	Version          string `json:"version,omitempty"`
	Runtime          string `json:"runtime,omitempty"`
	Handler          string `json:"handler,omitempty"`
}

type ConfigObjectItem

type ConfigObjectItem struct {
	Source   string `json:"source,omitempty"`
	Account  string `json:"account,omitempty"`
	Endpoint string `json:"endpoint,omitempty"`
	Bucket   string `json:"bucket,omitempty"`
	Object   string `json:"object,omitempty"`
	Unpack   string `json:"unpack,omitempty"`
	MD5      string `json:"md5,omitempty"`
	Ak       string `json:"ak,omitempty"`
	Sk       string `json:"sk,omitempty"`
}

type ConfigurationList

type ConfigurationList struct {
	Total       int                    `json:"total"`
	ListOptions *ListOptions           `json:"listOptions"`
	Items       []specV1.Configuration `json:"items"`
}

ConfigurationList Configuration List

type ConfigurationView

type ConfigurationView struct {
	Name              string            `json:"name,omitempty" validate:"resourceName,nonBaetyl"`
	Namespace         string            `json:"namespace,omitempty"`
	Labels            map[string]string `json:"labels,omitempty"`
	Data              []ConfigDataItem  `json:"data,omitempty" default:"[]" validate:"dive"`
	CreationTimestamp time.Time         `json:"createTime,omitempty"`
	UpdateTimestamp   time.Time         `json:"updateTime,omitempty"`
	Description       string            `json:"description,omitempty"`
	Version           string            `json:"version,omitempty"`
	System            bool              `json:"system,omitempty"`
}

type DesireRequest

type DesireRequest struct {
	Resources []*Resource `yaml:"resources,omitempty" json:"resources,omitempty"`
}

type DesireResponse

type DesireResponse struct {
	Resources []*Resource `yaml:"resources,omitempty" json:"resources,omitempty"`
}

type ExternalObjectInfo

type ExternalObjectInfo struct {
	Endpoint string `form:"endpoint,omitempty"`
	Ak       string `form:"ak,omitempty"`
	Sk       string `form:"sk,omitempty"`
}

type Filter

type Filter struct {
	PageNo   int    `form:"pageNo"`
	PageSize int    `form:"pageSize"`
	Name     string `form:"name,omitempty"`
}

func (*Filter) GetFuzzyName

func (f *Filter) GetFuzzyName() string

func (*Filter) GetLimitNumber

func (f *Filter) GetLimitNumber() int

func (*Filter) GetLimitOffset

func (f *Filter) GetLimitOffset() int

type Fingerprint

type Fingerprint struct {
	Type       int    `json:"type,omitempty"`
	SnPath     string `json:"snPath,omitempty"`
	InputField string `json:"inputField,omitempty"`
}

type Function

type Function struct {
	Name    string       `yaml:"name,omitempty" json:"name,omitempty" validate:"omitempty,resourceName,nonBaetyl"`
	Handler string       `yaml:"handler,omitempty" json:"handler,omitempty"`
	Version string       `yaml:"version,omitempty" json:"version,omitempty"`
	Runtime string       `yaml:"runtime,omitempty" json:"runtime,omitempty"`
	Code    FunctionCode `yaml:"code,omitempty" json:"code,omitempty"`
}

type FunctionCode

type FunctionCode struct {
	Size     int32  `yaml:"size,omitempty" json:"size,omitempty"`
	Sha256   string `yaml:"sha256,omitempty" json:"sha256,omitempty"`
	Location string `yaml:"location,omitempty" json:"location,omitempty"`
}

type FunctionSource

type FunctionSource struct {
	Name string `json:"name,omitempty"`
}

type FunctionSourceView

type FunctionSourceView struct {
	Sources  []FunctionSource  `json:"sources"`
	Runtimes map[string]string `json:"runtimes"`
}

type FunctionView

type FunctionView struct {
	Functions []Function `json:"functions"`
}

type Index

type Index struct {
	// contains filtered or unexported fields
}

type ListObjectsResult

type ListObjectsResult struct {
	Name           string
	Prefix         string
	Delimiter      string
	Marker         string
	NextMarker     string
	MaxKeys        int64
	IsTruncated    bool
	Contents       []ObjectSummaryType
	CommonPrefixes []PrefixType
}

type ListOptions

type ListOptions struct {
	LabelSelector string `json:"selector,omitempty"`
	FieldSelector string `json:"fieldSelector,omitempty"`
	Limit         int64  `json:"limit,omitempty"`
	Continue      string `json:"continue,omitempty"`
}

type ListView

type ListView struct {
	Total    int         `json:"total"`
	PageNo   int         `json:"pageNo"`
	PageSize int         `json:"pageSize"`
	Items    interface{} `json:"items,omitempty"`
}

type MisData

type MisData struct {
	Count int         `json:"count,omitempty"`
	Rows  interface{} `json:"rows,omitempty"`
}

type Namespace

type Namespace struct {
	Name string `json:"name,omitempty" validate:"namespace"`
}

Namespace Namespace

type NodeList

type NodeList struct {
	Total       int           `json:"total"`
	ListOptions *ListOptions  `json:"listOptions"`
	Items       []specV1.Node `json:"items"`
}

NodeList node list

type NodeNames

type NodeNames struct {
	Names []string `json:"names,"validate:"maxLength=20"`
}

type NodeViewList

type NodeViewList struct {
	Total       int               `json:"total"`
	ListOptions *ListOptions      `json:"listOptions"`
	Items       []specV1.NodeView `json:"items"`
}

NodeViewList node view list

type Object

type Object struct {
	ObjectMeta
	Body io.ReadCloser
}

type ObjectMeta

type ObjectMeta struct {
	AcceptRanges       string
	CacheControl       string
	ContentDisposition string
	ContentEncoding    string
	ContentLength      int64
	ContentType        string
	ETag               string
	Expires            string
	LastModified       time.Time
	StorageClass       string
}

type ObjectParams

type ObjectParams struct {
	Marker    string
	MaxKeys   int64
	Prefix    string
	Delimiter string
}

type ObjectRequestParams

type ObjectRequestParams struct {
	Source             string             `json:"source,omitempty"`
	Bucket             string             `json:"bucket,omitempty"`
	Account            string             `form:"account,omitempty"`
	ExternalObjectInfo ExternalObjectInfo `form:",inline"`
}

type ObjectStorageSource

type ObjectStorageSource struct {
	Name string `json:"name,omitempty"`
}

type ObjectStorageSourceV2

type ObjectStorageSourceV2 struct {
	AccountEnabled bool `json:"accountEnabled,omitempty"`
}

type ObjectStorageSourceView

type ObjectStorageSourceView struct {
	Sources []ObjectStorageSource `json:"sources"`
}

type ObjectStorageSourceViewV2

type ObjectStorageSourceViewV2 struct {
	Sources map[string]ObjectStorageSourceV2 `json:"sources"`
}

type ObjectSummaryType

type ObjectSummaryType struct {
	ETag         string
	Key          string
	LastModified time.Time
	Size         int64
	StorageClass string
}

type ObjectURL

type ObjectURL struct {
	URL   string
	MD5   string
	Token string
}

type ObjectView

type ObjectView struct {
	Name string `json:"name,omitempty"`
}

type ObjectsView

type ObjectsView struct {
	Objects []ObjectView `json:"objects"`
}

type PEMCredential

type PEMCredential struct {
	CertPEM []byte
	KeyPEM  []byte
	CertId  string
}

PEMCredential holds a certificate, private key pem data

type Package

type Package struct {
	Url string `json:"url,omitempty"`
	MD5 string `json:"md5,omitempty"`
	Cmd string `json:"cmd,omitempty"`
}

type PackageParam

type PackageParam struct {
	Platform string `form:"platform"`
}

type PrefixType

type PrefixType struct {
	Prefix string
}

type Property

type Property struct {
	Name       string    `yaml:"name,omitempty" json:"name,omitempty" db:"name"`
	Value      string    `yaml:"value,omitempty" json:"value,omitempty" db:"value"`
	CreateTime time.Time `yaml:"createTime,omitempty" json:"createTime,omitempty" db:"create_time"`
	UpdateTime time.Time `yaml:"updateTime,omitempty" json:"updateTime,omitempty" db:"update_time"`
}

type Record

type Record struct {
	Name             string    `json:"name,omitempty" db:"name"`
	Namespace        string    `json:"namespace,omitempty" db:"namespace"`
	BatchName        string    `json:"batchName,omitempty" db:"batch_name"`
	FingerprintValue string    `json:"fingerprintValue,omitempty" db:"fingerprint_value" validate:"omitempty,fingerprintValue"`
	Active           int       `json:"active,omitempty" db:"active"`
	NodeName         string    `json:"nodeName,omitempty" db:"node_name" validate:"omitempty,resourceName"`
	ActiveIP         string    `json:"activeIP,omitempty" db:"active_ip"`
	ActiveTime       time.Time `json:"activeTime,omitempty" db:"active_time"`
	CreateTime       time.Time `json:"createTime,omitempty" db:"create_time"`
	UpdateTime       time.Time `json:"updateTime,omitempty" db:"update_time"`
}

type Registry

type Registry struct {
	Name              string    `json:"name,omitempty" validate:"omitempty,resourceName,nonBaetyl"`
	Namespace         string    `json:"namespace,omitempty"`
	Address           string    `json:"address"`
	Username          string    `json:"username"`
	Password          string    `json:"password,omitempty"`
	CreationTimestamp time.Time `json:"createTime,omitempty"`
	UpdateTimestamp   time.Time `json:"updateTime,omitempty"`
	Description       string    `json:"description"`
	Version           string    `json:"version,omitempty"`
}

Registry Registry

func FromSecretToRegistry

func FromSecretToRegistry(s *specV1.Secret) *Registry

func (*Registry) Equal

func (r *Registry) Equal(target *Registry) bool

func (*Registry) ToSecret

func (r *Registry) ToSecret() *specV1.Secret

type RegistryList

type RegistryList struct {
	Total       int          `json:"total"`
	ListOptions *ListOptions `json:"listOptions"`
	Items       []Registry   `json:"items"`
}

RegistryList Registry List

func FromSecretListToRegistryList

func FromSecretListToRegistryList(s *SecretList) *RegistryList

type RegistryView

type RegistryView struct {
	Name     string `json:"name,omitempty"`
	Address  string `json:"address,omitempty"`
	Username string `json:"username,omitempty"`
}

type Resource

type Resource struct {
	Type    string      `yaml:"type,omitempty" json:"type,omitempty"`
	Name    string      `yaml:"name,omitempty" json:"name,omitempty"`
	Version string      `yaml:"version,omitempty" json:"version,omitempty"`
	Value   interface{} `yaml:"value,omitempty" json:"value,omitempty"`
}

type ResponseInfo

type ResponseInfo struct {
	Delta    interface{}            `yaml:"delta,omitempty" json:"delta,omitempty"`
	Metadata map[string]interface{} `yaml:"metadata,omitempty" json:"metadata,omitempty" default:"{}"`
}

type SecretList

type SecretList struct {
	Total       int             `json:"total"`
	ListOptions *ListOptions    `json:"listOptions"`
	Items       []specV1.Secret `json:"items"`
}

type SecretView

type SecretView struct {
	Name              string            `json:"name,omitempty" validate:"omitempty,resourceName"`
	Namespace         string            `json:"namespace,omitempty"`
	Data              map[string]string `json:"data,omitempty" binding:"required"`
	CreationTimestamp time.Time         `json:"createTime,omitempty"`
	UpdateTimestamp   time.Time         `json:"updateTime,omitempty"`
	Description       string            `json:"description"`
	Version           string            `json:"version,omitempty"`
}

func FromSecretToView

func FromSecretToView(s *specV1.Secret) *SecretView

func (*SecretView) Equal

func (s *SecretView) Equal(target *SecretView) bool

func (*SecretView) ToSecret

func (s *SecretView) ToSecret() *specV1.Secret

type SecretViewList

type SecretViewList struct {
	Total       int          `json:"total"`
	ListOptions *ListOptions `json:"listOptions"`
	Items       []SecretView `json:"items"`
}

func FromSecretListToView

func FromSecretListToView(s *SecretList) *SecretViewList

type ServiceFunction

type ServiceFunction struct {
	Functions []specV1.ServiceFunction `json:"functions,omitempty"`
}

type Shadow

type Shadow struct {
	Namespace         string    `json:"namespace,omitempty"`
	Name              string    `json:"name,omitempty"`
	Report            v1.Report `json:"report,omitempty"`
	Desire            v1.Desire `json:"desire,omitempty"`
	CreationTimestamp time.Time `json:"createTime,omitempty"`
}

func NewShadow

func NewShadow(namespace, name string) *Shadow

func NewShadowFromNode

func NewShadowFromNode(node *v1.Node) *Shadow

func (*Shadow) GetDesireString

func (s *Shadow) GetDesireString() (string, error)

func (*Shadow) GetReportString

func (s *Shadow) GetReportString() (string, error)

type ShadowList

type ShadowList struct {
	Total       int          `json:"total"`
	ListOptions *ListOptions `json:"listOptions"`
	Items       []Shadow     `json:"items"`
}

NodeViewList node view list

type SysConfig

type SysConfig struct {
	Type       string    `yaml:"type,omitempty" json:"type,omitempty" db:"type"`
	Key        string    `yaml:"key,omitempty" json:"key,omitempty" db:"name"`
	Value      string    `yaml:"value,omitempty" json:"value,omitempty" db:"value"`
	CreateTime time.Time `yaml:"createTime,omitempty" json:"createTime,omitempty" db:"create_time"`
	UpdateTime time.Time `yaml:"updateTime,omitempty" json:"updateTime,omitempty" db:"update_time"`
}

type SysConfigView

type SysConfigView struct {
	SysConfigs []SysConfig `json:"sysconfigs"`
}

type Task

type Task struct {
	TraceId    string    `json:"trace_id,omitempty" db:"trace_id"`
	Namespace  string    `json:"namespace,omitempty" db:"namespace"`
	Node       string    `json:"node,omitempty" db:"node"`
	Type       string    `json:"type,omitempty" db:"type"`
	State      string    `json:"state,omitempty" db:"state"`
	Step       string    `json:"step,omitempty" db:"step"`
	OldVersion string    `json:"old_version,omitempty" db:"old_version"`
	NewVersion string    `json:"new_version,omitempty" db:"new_version"`
	CreateTime time.Time `json:"createTime,omitempty" db:"create_time"`
	UpdateTime time.Time `json:"updateTime,omitempty" db:"update_time"`
}

type VolumeView

type VolumeView struct {
	// specified name of the volume
	Name        string                       `json:"name,omitempty" binding:"required" validate:"omitempty,resourceName"`
	HostPath    *specV1.HostPathVolumeSource `json:"hostPath,omitempty"`
	Config      *specV1.ObjectReference      `json:"config,omitempty"`
	Secret      *specV1.ObjectReference      `json:"secret,omitempty"`
	Certificate *specV1.ObjectReference      `json:"certificate,omitempty"`
}

VolumeView volume view

Jump to

Keyboard shortcuts

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