models

package
v2.2.0-rc91 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 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

func GetPagingParam added in v2.2.0

func GetPagingParam(listOptions *ListOptions, resLen int) (start, end int)

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"`
	Mode              string            `json:"mode,omitempty" default:"kube"`
	Type              string            `json:"type,omitempty" default:"container"`
	Labels            map[string]string `json:"labels,omitempty"`
	Selector          string            `json:"selector"`
	NodeSelector      string            `json:"nodeSelector"`
	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 `json:",inline"`
	Items        []AppItem `json:"items"`
}

ApplicationList app List

type ApplicationView

type ApplicationView struct {
	Name              string            `json:"name,omitempty" validate:"resourceName"`
	Mode              string            `json:"mode,omitempty" default:"kube"`
	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"`
	NodeSelector      string            `json:"nodeSelector,omitempty"`
	Services          []ServiceView     `json:"services,omitempty" validate:"dive"`
	Volumes           []VolumeView      `json:"volumes,omitempty" validate:"dive"`
	Description       string            `json:"description,omitempty"`
	System            bool              `json:"system,omitempty"`
	Registries        []RegistryView    `json:"registries,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 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"`
	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, needToFilter bool) *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 `json:",inline"`
	Items        []Certificate `json:"items"`
}

CertificateList Certificate List

func FromSecretListToCertificateList

func FromSecretListToCertificateList(s *SecretList, needToFilter bool) *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 `json:",inline"`
	Items        []specV1.Configuration `json:"items"`
}

ConfigurationList Configuration List

type ConfigurationView

type ConfigurationView struct {
	Name              string            `json:"name,omitempty" validate:"resourceName"`
	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" json:"pageNo,omitempty"`
	PageSize int    `form:"pageSize" json:"pageSize,omitempty"`
	Name     string `form:"name,omitempty" json:"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 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 `form:"selector,omitempty" json:"selector,omitempty"`
	NodeSelector  string `form:"nodeSelector,omitempty" json:"nodeSelector,omitempty"`
	FieldSelector string `form:"fieldSelector,omitempty" json:"fieldSelector,omitempty"`
	Limit         int64  `form:"limit,omitempty" json:"limit,omitempty"`
	Continue      string `form:"continue,omitempty" json:"continue,omitempty"`
	Filter        `json:",inline"`
}

type ListView

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

type MisData

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

type Module added in v2.2.0

type Module struct {
	Name              string            `json:"name,omitempty"`
	Version           string            `json:"version,omitempty"`
	Image             string            `json:"image,omitempty"`
	Programs          map[string]string `json:"programs,omitempty"`
	Type              string            `json:"type,omitempty"`
	IsLatest          bool              `json:"isLatest,omitempty"`
	Description       string            `json:"description,omitempty"`
	CreationTimestamp time.Time         `json:"createTime,omitempty"`
	UpdateTimestamp   time.Time         `json:"updateTime,omitempty"`
}

type Namespace

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

Namespace Namespace

type NamespaceList added in v2.2.0

type NamespaceList struct {
	Total        int `json:"total"`
	*ListOptions `json:",inline"`
	Items        []Namespace `json:"items"`
}

NamespaceList namespace list

type NodeCoreConfigs added in v2.2.0

type NodeCoreConfigs struct {
	Version string `yaml:"version,omitempty" json:"version,omitempty"`
	// unit: seconds
	Frequency int `yaml:"frequency,omitempty" json:"frequency,omitempty"`
	APIPort   int `yaml:"apiport,omitempty" json:"apiport,omitempty"`
}

type NodeCoreVersions added in v2.2.0

type NodeCoreVersions struct {
	Versions []string `yaml:"versions,omitempty" json:"versions,omitempty"`
}

type NodeList

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

NodeList node list

type NodeMode added in v2.1.1

type NodeMode struct {
	Mode string `yaml:"mode,omitempty" json:"mode,omitempty"`
}

type NodeNames

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

type NodeOptionalSysApps added in v2.2.0

type NodeOptionalSysApps struct {
	Apps []NodeSysAppView `yaml:"apps,omitempty" json:"apps,omitempty"`
}

type NodeProperties added in v2.1.1

type NodeProperties struct {
	State NodePropertiesState    `yaml:"state,omitempty" json:"state,omitempty"`
	Meta  NodePropertiesMetadata `yaml:"metadata,omitempty" json:"metadata,omitempty"`
}

type NodePropertiesMetadata added in v2.1.1

type NodePropertiesMetadata struct {
	ReportMeta map[string]interface{} `yaml:"report,omitempty" json:"report,omitempty"`
	DesireMeta map[string]interface{} `yaml:"desire,omitempty" json:"desire,omitempty"`
}

type NodePropertiesState added in v2.1.1

type NodePropertiesState struct {
	Report map[string]interface{} `yaml:"report,omitempty" json:"report,omitempty"`
	Desire map[string]interface{} `yaml:"desire,omitempty" json:"desire,omitempty"`
}

type NodeProperty added in v2.1.1

type NodeProperty struct {
	Name    string        `yaml:"name,omitempty" json:"name,omitempty"`
	Type    string        `yaml:"type,omitempty" json:"type,omitempty"`
	Current PropertyValue `yaml:"current,omitempty" json:"current,omitempty"`
	Expect  PropertyValue `yaml:"expect,omitempty" json:"expect,omitempty"`
}

type NodeSysAppInfo added in v2.2.0

type NodeSysAppInfo struct {
	Name        string            `yaml:"name,omitempty" json:"name,omitempty"`
	Image       string            `yaml:"image,omitempty" json:"image,omitempty"`
	Description string            `yaml:"description,omitempty" json:"description,omitempty"`
	Programs    map[string]string `yaml:"programs,omitempty" json:"programs,omitempty"`
}

type NodeSysAppView added in v2.2.0

type NodeSysAppView struct {
	Name        string `yaml:"name,omitempty" json:"name,omitempty"`
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
}

type NodeViewList

type NodeViewList struct {
	Total        int `json:"total"`
	*ListOptions `json:",inline"`
	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 PropertyValue added in v2.1.1

type PropertyValue struct {
	Value      string `yaml:"value,omitempty" json:"value,omitempty"`
	UpdateTime string `yaml:"updateTime,omitempty" json:"updateTime,omitempty"`
}

type Quota added in v2.1.1

type Quota struct {
	Namespace string `json:"namespace" validate:"required"`
	QuotaName string `json:"quotaName,omitempty"`
	Quota     int    `json:"quota" default:0`
	UsedNum   int    `json:"usedNum" default:0`
}

Quota

type Registry

type Registry struct {
	Name              string    `json:"name,omitempty" validate:"omitempty,resourceName"`
	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, needToFilter bool) *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 `json:",inline"`
	Items        []Registry `json:"items"`
}

RegistryList Registry List

func FromSecretListToRegistryList

func FromSecretListToRegistryList(s *SecretList, needToFilter bool) *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 `json:",inline"`
	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, needToFilter bool) *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 `json:",inline"`
	Items        []SecretView `json:"items"`
}

func FromSecretListToView

func FromSecretListToView(s *SecretList, needToFilter bool) *SecretViewList

type ServiceFunction

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

type ServiceView added in v2.2.0

type ServiceView struct {
	specV1.Service `json:",inline"`
	ProgramConfig  string `json:"programConfig,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"`
	ReportMeta        v1.Report `json:"reportMeta,omitempty"`
	DesireMeta        v1.Desire `json:"desireMeta,omitempty"`
	CreationTimestamp time.Time `json:"createTime,omitempty"`
	DesireVersion     string    `json:"desireVersion,omitempty"`
}

func NewShadow

func NewShadow(namespace, name string) *Shadow

func NewShadowFromNode

func NewShadowFromNode(node *v1.Node) *Shadow

func (*Shadow) GetDesireMetaString added in v2.2.0

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

func (*Shadow) GetDesireString

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

func (*Shadow) GetReportMetaString added in v2.2.0

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

func (*Shadow) GetReportString

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

type ShadowList

type ShadowList struct {
	Total        int `json:"total"`
	*ListOptions `json:",inline"`
	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 {
	Id               int64                 `json:"id,omitempty"`
	Name             string                `json:"name,omitempty"`
	RegistrationName string                `json:"registrationName,omitempty"`
	Namespace        string                `json:"namespace,omitempty"`
	ResourceName     string                `json:"resourceName,omitempty"`
	ResourceType     string                `json:"resourceType,omitempty"`
	Version          int64                 `json:"version,omitempty"`
	ExpireTime       int64                 `json:"expireTime,omitempty"`
	Status           TaskStatus            `json:"status,omitempty"`
	ProcessorsStatus map[string]TaskStatus `json:"processorsStatus,omitempty"`
}

type TaskStatus added in v2.2.0

type TaskStatus int
const (
	TaskNew TaskStatus = iota
	TaskProcessing
	TaskNeedRetry
	TaskFinished
	TaskFailed
)

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