model

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnableDecodeUserHeaderData    = errors.New("unable to decode user header data")
	ErrUnableUnmarshalUserHeaderData = errors.New("unable to unmarshal user header data")

	ErrUnableConvertServiceList = errors.New("unable to decode services list")
	ErrUnableConvertService     = errors.New("unable to decode service")

	ErrUnableConvertVolumeList = errors.New("unable to decode volumes list")
	ErrUnableConvertVolume     = errors.New("unable to decode volume")

	ErrUnableConvertNamespaceList = errors.New("unable to decode projects list")
	ErrUnableConvertNamespace     = errors.New("unable to decode project")

	ErrUnableConvertSecretList = errors.New("unable to decode secrets list")
	ErrUnableConvertSecret     = errors.New("unable to decode secret")

	ErrUnableConvertIngressList = errors.New("unable to decode ingresses list")
	ErrUnableConvertIngress     = errors.New("unable to decode ingress")

	ErrUnableConvertDeploymentList = errors.New("unable to decode deployment list")
	ErrUnableConvertDeployment     = errors.New("unable to decode deployment")

	ErrUnableConvertEndpointList = errors.New("unable to decode services list")
	ErrUnableConvertEndpoint     = errors.New("unable to decode service")

	ErrUnableConvertConfigMapList = errors.New("unable to decode config maps list")
	ErrUnableConvertConfigMap     = errors.New("unable to decode config map")

	ErrUnableConvertStorageList = errors.New("unable to decode storage class list")
)

Functions

func IsValidUUID

func IsValidUUID(u string) bool

IsValidUUID checks if UUID is valid

func MakeResourceQuota

func MakeResourceQuota(ns string, labels map[string]string, resources kube_types.Resource) (*api_core.ResourceQuota, []error)

MakeResourceQuota creates kubernetes v1.ResourceQuota from cpu, memory, labels and namespace name

func ParseForUser

func ParseForUser(ns *kube_types.Namespace, headers UserHeaderDataMap) *kube_types.Namespace

func ParseKubeConfigMap

func ParseKubeConfigMap(cmi interface{}, parseforuser bool) (*kube_types.ConfigMap, error)

ParseKubeConfigMap parses kubernetes v1.ConfigMap to more convenient ConfigMap struct.

func ParseKubeConfigMapList

func ParseKubeConfigMapList(cmi interface{}, parseforuser bool) (*kube_types.ConfigMapsList, error)

ParseKubeConfigMapList parses kubernetes v1.ConfigMapList to more convenient []ConfigMap struct.

func ParseKubeDeployment

func ParseKubeDeployment(deployment interface{}, parseforuser bool) (*kube_types.Deployment, error)

ParseKubeDeployment parses kubernetes v1.Deployment to more convenient Deployment struct

func ParseKubeDeploymentList

func ParseKubeDeploymentList(deploys interface{}, parseforuser bool) (*kube_types.DeploymentsList, error)

ParseKubeDeploymentList parses kubernetes v1.DeploymentList to more convenient []Deployment struct

func ParseKubeIngress

func ParseKubeIngress(ingressi interface{}, parseforuser bool) (*kube_types.Ingress, error)

ParseKubeIngress parses kubernetes v1beta1.Ingress to more convenient Ingress struct

func ParseKubeIngressList

func ParseKubeIngressList(ingressi interface{}, parseforuser bool) (*kube_types.IngressesList, error)

ParseKubeIngressList parses kubernetes v1beta1.IngressList to more convenient []Ingress struct

func ParseKubePersistentVolumeClaim

func ParseKubePersistentVolumeClaim(pvci interface{}, parseforuser bool) (*kube_types.Volume, error)

ParseKubePersistentVolumeClaim parses kubernetes v1.PersistentVolume to more convenient PersistentVolumeClaimWithOwner struct.

func ParseKubePersistentVolumeClaimList

func ParseKubePersistentVolumeClaimList(ns interface{}, parseforuser bool) (*kube_types.VolumesList, error)

ParseKubePersistentVolumeClaimList parses kubernetes v1.PersistentVolumeClaimList to more convenient PersistentVolumeClaimList struct.

func ParseKubePod

func ParseKubePod(pod interface{}, parseforuser bool) kube_types.Pod

ParseKubePod parses kubernetes v1.PodList to more convenient Pod struct.

func ParseKubePodList

func ParseKubePodList(pods interface{}, parseforuser bool) *kube_types.PodsList

ParseKubePodList parses kubernetes v1.PodList to more convenient []Pod struct.

func ParseKubeResourceQuota

func ParseKubeResourceQuota(quota interface{}) (*kube_types.Namespace, error)

ParseKubeResourceQuota parses kubernetes v1.ResourceQuota to more convenient Namespace struct. (resource quouta contains all fields that parent namespace contains)

func ParseKubeResourceQuotaList

func ParseKubeResourceQuotaList(quotas interface{}) (*kube_types.NamespacesList, error)

ParseKubeResourceQuotaList parses kubernetes v1.ResourceQuotaList to more convenient []Namespace struct. (resource quouta contains all fields that parent namespace contains)

func ParseKubeSecret

func ParseKubeSecret(secreti interface{}, parseforuser bool) (*kube_types.Secret, error)

ParseKubeSecret parses kubernetes v1.Secret to more convenient Secret struct.

func ParseKubeSecretList

func ParseKubeSecretList(secreti interface{}, parseforuser bool) (*kube_types.SecretsList, error)

ParseKubeSecretList parses kubernetes v1.SecretList to more convenient []Secret struct.

func ParseKubernetesResourceError

func ParseKubernetesResourceError(in interface{}, defaultErr *cherry.Err) *cherry.Err

ParseKubernetesResourceError checks error status

func ParseNamespaceListForUser

func ParseNamespaceListForUser(headers UserHeaderDataMap, nsl []kube_types.Namespace) *kube_types.NamespacesList

func UpdateImage

func UpdateImage(deployment interface{}, containerName, newimage string) (*api_apps.Deployment, error)

func ValidateResourceQuota

func ValidateResourceQuota(cpu, mem uint) []error

Types

type ConfigMapKubeAPI

type ConfigMapKubeAPI kube_types.ConfigMap

func (*ConfigMapKubeAPI) ToKube

func (cm *ConfigMapKubeAPI) ToKube(nsName string, labels map[string]string) (*api_core.ConfigMap, []error)

ToKube creates kubernetes v1.ConfigMap from ConfigMap struct and namespace labels

func (*ConfigMapKubeAPI) Validate

func (cm *ConfigMapKubeAPI) Validate() []error

type DeploymentKubeAPI

type DeploymentKubeAPI kube_types.Deployment

func (*DeploymentKubeAPI) ToKube

func (deploy *DeploymentKubeAPI) ToKube(nsName string, labels map[string]string) (*api_apps.Deployment, []error)

ToKube creates kubernetes v1.Deployment from Deployment struct and namespace labels

func (*DeploymentKubeAPI) Validate

func (deploy *DeploymentKubeAPI) Validate() []error

type Endpoint

type Endpoint struct {
	// required: true
	Name  string `json:"name"`
	Owner string `json:"owner,omitempty"`
	//creation date in RFC3339 format
	CreatedAt *string `json:"created_at,omitempty"`
	// required: true
	Addresses []string `json:"addresses"`
	// required: true
	Ports []Port `json:"ports"`
}

Endpoint -- model for endpoint

swagger:model

func ParseKubeEndpoint

func ParseKubeEndpoint(endpointi interface{}) (*Endpoint, error)

ParseKubeEndpoint parses kubernetes v1.Endpoint to more convenient Endpoint struct

func (*Endpoint) ToKube

func (endpoint *Endpoint) ToKube(nsName string, labels map[string]string) (*api_core.Endpoints, []error)

ToKube creates kubernetes v1.Endpoint from Endpoint struct and namespace labels

func (*Endpoint) Validate

func (endpoint *Endpoint) Validate() []error

type EndpointsList

type EndpointsList struct {
	Endpoints []Endpoint `json:"endpoints"`
}

EndpointsList -- model for endpoints list

swagger:model

func ParseKubeEndpointList

func ParseKubeEndpointList(endpointi interface{}) (*EndpointsList, error)

ParseKubeEndpointList parses kubernetes v1.EndpointsList to more convenient []Endpoint struct

type IngressKubeAPI

type IngressKubeAPI kube_types.Ingress

func (*IngressKubeAPI) ToKube

func (ingress *IngressKubeAPI) ToKube(nsName string, labels map[string]string) (*api_extensions.Ingress, []error)

ToKube creates kubernetes v1beta1.Ingress from Ingress struct and namespace labels

func (*IngressKubeAPI) Validate

func (ingress *IngressKubeAPI) Validate() []error

type NamespaceKubeAPI

type NamespaceKubeAPI kube_types.Namespace

func (*NamespaceKubeAPI) ToKube

func (ns *NamespaceKubeAPI) ToKube() (*api_core.Namespace, []error)

ToKube creates kubernetes v1.Namespace from Namespace struct

func (*NamespaceKubeAPI) Validate

func (ns *NamespaceKubeAPI) Validate() []error

type Port

type Port struct {
	// required: true
	Name string `json:"name"`
	// required: true
	Port int `json:"port"`
	// required: true
	Protocol kube_types.Protocol `json:"protocol"`
}

Port -- model for endpoint port

swagger:model

type SecretKubeAPI added in v1.0.5

type SecretKubeAPI kube_types.Secret

func (*SecretKubeAPI) ToKube added in v1.0.5

func (secret *SecretKubeAPI) ToKube(nsName string, labels map[string]string, secretType api_core.SecretType) (*api_core.Secret, []error)

ToKube creates kubernetes v1.Secret from Secret struct and namespace labels

func (*SecretKubeAPI) Validate added in v1.0.5

func (secret *SecretKubeAPI) Validate() []error

type ServiceWithParam

type ServiceWithParam struct {
	// swagger: allOf
	*kube_types.Service
	//hide service from users
	Hidden bool `json:"hidden,omitempty"`
}

ServiceWithParam -- model for service with owner

swagger:model

func ParseKubeService

func ParseKubeService(srv interface{}, parseforuser bool) (*ServiceWithParam, error)

ParseKubeService parses kubernetes v1.Service to more convenient Service struct.

func (*ServiceWithParam) ParseForUser

func (service *ServiceWithParam) ParseForUser()

ParseForUser removes information not interesting for users

func (*ServiceWithParam) ToKube

func (service *ServiceWithParam) ToKube(nsName string, labels map[string]string) (*api_core.Service, []error)

ToKube creates kubernetes v1.Service from Service struct and namespace labels

func (*ServiceWithParam) Validate

func (service *ServiceWithParam) Validate() []error

type ServiceWithParamList

type ServiceWithParamList struct {
	Services []ServiceWithParam `json:"services"`
}

ServiceWithParamList -- model for services list

swagger:model

func ParseKubeServiceList

func ParseKubeServiceList(ns interface{}, parseforuser bool) (*ServiceWithParamList, error)

ParseKubeServiceList parses kubernetes v1.ServiceList to more convenient Service struct.

type StorageList added in v1.0.6

type StorageList []string

StorageList -- model for storage names list

swagger:model

func ParseStoragesList added in v1.0.6

func ParseStoragesList(storages interface{}) (*StorageList, error)

ParseStoragesList parses kubernetes v1.StorageClassList to more convenient StorageList struct.

type UserHeaderDataMap

type UserHeaderDataMap map[string]model.UserHeaderData

func ParseUserHeaderData

func ParseUserHeaderData(str string) (*UserHeaderDataMap, error)

ParseUserHeaderData decodes headers for substitutions

type VolumeKubeAPI

type VolumeKubeAPI kube_types.Volume

func (*VolumeKubeAPI) Resize added in v1.0.6

ToKube creates kubernetes v1.Service from Service struct and namespace labels

func (*VolumeKubeAPI) ToKube

func (pvc *VolumeKubeAPI) ToKube(nsName string, labels map[string]string) (*api_core.PersistentVolumeClaim, []error)

ToKube creates kubernetes v1.Service from Service struct and namespace labels

func (*VolumeKubeAPI) Validate

func (pvc *VolumeKubeAPI) Validate() []error

Jump to

Keyboard shortcuts

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