models

package
v0.0.0-...-84f28dd Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Once sync.Once
)

Functions

func CreatePV

func CreatePV(req *PV) (int, error)

func CreatePVC

func CreatePVC(req *PVC) (int, error)

func DeletePV

func DeletePV(req *Delete) (int, error)

func DeletePVC

func DeletePVC(req *Delete) (int, error)

func GetClientset

func GetClientset() *kubernetes.Clientset

func GetPV

func GetPV() *apiv1.PersistentVolumeList

func Getbaseimage

func Getbaseimage(dep string) (string, error)

func Getorg

func Getorg() orm.Ormer

func Gettime

func Gettime() string

func Insertbaseimage

func Insertbaseimage(dep string, image string, ver string) error

func Insertlog

func Insertlog(log *Log)

func LinkTomysql

func LinkTomysql() (*sql.DB, error)

func Truncate

func Truncate()

func Updateimage

func Updateimage(dep string, image string) error

Types

type AutoScale

type AutoScale struct {
	MinReplicas            int32 `json:"minReplicas"`
	MaxReplicas            int32 `json:"maxReplicas"`
	TargetCPUPercentage    int32 `json:"targetCPUPercentage"`
	TargetMemoryPercentage int32 `json:"targetMemoryPercentage"`
}

type Container

type Container struct {
	Name          string      `json:"name"`
	Image         string      `json:"image"`
	ContainerPort int32       `json:"containerPort" protobuf:"varint,3,opt,name=containerPort"`
	Protocol      string      `json:"protocol,omitempty" protobuf:"bytes,4,opt,name=protocol,casttype=Protocol"`
	Env           []v1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,7,rep,name=env"`
}

type Delete

type Delete struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type Deployment

type Deployment struct {
	Name       string            `json:"name"`
	Namespace  string            `json:"namespace"`
	Labels     map[string]string `json:"labels"`
	Desc       string            `json:"desc"`
	Replicas   int32             `json:"replicas"`
	Containers []Container       `json:"containers"`
}

type DeploymentList

type DeploymentList struct {
	TypeMeta TypeMeta `json:"typeMeta,inline"`
	// Standard list metadata.
	// +optional
	ListMeta ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Items is the list of Deployments.
	Items []Deployment `json:"items" protobuf:"bytes,2,rep,name=items"`
}

type Error

type Error struct {
	Error string `json:"error"`
	Code  int    `json:"code"`
}

type ListMeta

type ListMeta struct {
	// selfLink is a URL representing this object.
	// Populated by the system.
	// Read-only.
	// +optional
	SelfLink string `json:"selfLink,omitempty" protobuf:"bytes,1,opt,name=selfLink"`

	// String that identifies the server's internal version of this object that
	// can be used by clients to determine when objects have changed.
	// Value must be treated as opaque by clients and passed unmodified back to the server.
	// Populated by the system.
	// Read-only.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#concurrency-control-and-consistency
	// +optional
	ResourceVersion string `json:"resourceVersion,omitempty" protobuf:"bytes,2,opt,name=resourceVersion"`

	// continue may be set if the user set a limit on the number of items returned, and indicates that
	// the server has more data available. The value is opaque and may be used to issue another request
	// to the endpoint that served this list to retrieve the next set of available objects. Continuing a
	// list may not be possible if the server configuration has changed or more than a few minutes have
	// passed. The resourceVersion field returned when using this continue value will be identical to
	// the value in the first response.
	Continue string `json:"continue,omitempty" protobuf:"bytes,3,opt,name=continue"`
}

type Log

type Log struct {
	Time  string `orm:"pk;column(time)" json:"time"`
	Etype string `orm:"column(etype)" json:"etype"`
	Event string `orm:"column(event)" json:"event"`
}

func Readlog

func Readlog() []Log

type PV

type PV struct {
	Name            string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
	StorageName     string `json:"storageName"`
	AccessModes     string `json:"accessModes,omitempty" protobuf:"bytes,3,rep,name=accessModes,casttype=PersistentVolumeAccessMode"`
	StorageQuantity string `json:"storageQuantity"`
	NfsServer       string `json:"nfsserver"`
	NfsPath         string `json:"nfspath"`
}

type PVC

type PVC struct {
	Name            string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
	StorageName     string `json:"storageName"`
	AccessModes     string `json:"accessModes,omitempty" protobuf:"bytes,3,rep,name=accessModes,casttype=PersistentVolumeAccessMode"`
	StorageQuantity string `json:"storageQuantity"`
	NfsServer       string `json:"nfsserver"`
	NfsPath         string `json:"nfspath"`
	Namespace       string `json:"namespace"`
}

type PersistentVolumeAccessMode

type PersistentVolumeAccessMode string
const (
	// can be mounted read/write mode to exactly 1 host
	ReadWriteOnce PersistentVolumeAccessMode = "ReadWriteOnce"
	// can be mounted in read-only mode to many hosts
	ReadOnlyMany PersistentVolumeAccessMode = "ReadOnlyMany"
	// can be mounted in read/write mode to many hosts
	ReadWriteMany PersistentVolumeAccessMode = "ReadWriteMany"
)

type Pod

type Pod struct {
	Name       string      `json:"name"`
	Namespace  string      `json:"namespace"`
	Desc       string      `json:"desc"`
	Containers []Container `json:"containers"`
}

type PodList

type PodList struct {
	TypeMeta TypeMeta `json:"typeMeta,inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	ListMeta ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// List of pods.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md
	Items []Pod `json:"items" protobuf:"bytes,2,rep,name=items"`
}

type Port

type Port struct {
	ContainerPort int    `json:"containerPort"`
	ServicePort   int32  `json:"servicePort"`
	Protocol      string `json:"protocol"`
	NodePort      int32  `json:"nodePort,omitempty" protobuf:"varint,5,opt,name=nodePort"`
}

type Response

type Response struct {
	Action string `json:"action"`
	Status string `json:"status"`
}

type Service

type Service struct {
	Name      string            `json:"name"`
	Namespace string            `json:"namespace"`
	Ports     []Port            `json:"ports"`
	Selector  map[string]string `json:"selector,omitempty" protobuf:"bytes,2,rep,name=selector"`
	Type      v1.ServiceType    `json:"type,omitempty" protobuf:"bytes,4,opt,name=type,casttype=ServiceType"`
}

type ServiceList

type ServiceList struct {
	TypeMeta TypeMeta `json:"typeMeta,inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	ListMeta ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// List of services
	Items []Service `json:"items" protobuf:"bytes,2,rep,name=items"`
}

type ServiceType

type ServiceType string

type StatefulSetList

type StatefulSetList struct {
	TypeMeta TypeMeta `json:",inline"`
	// +optional
	ListMeta ListMeta      `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	Items    []Statefulset `json:"items" protobuf:"bytes,2,rep,name=items"`
}

type Statefulset

type Statefulset struct {
	Name        string      `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"`
	StorageName string      `json:"storageName"`
	Namespace   string      `json:"namespace"`
	Replicas    int32       `json:"replicas"`
	Requests    string      `json:"requests"`
	Containers  []Container `json:"containers"`
	VMname      string      `json:"vmname"`
	MountPath   string      `json:"mountpath"`
	AccessModes string      `json:"accessModes,omitempty" protobuf:"bytes,3,rep,name=accessModes,casttype=PersistentVolumeAccessMode"`
}

type TypeMeta

type TypeMeta struct {
	// Kind is a string value representing the REST resource this object represents.
	// Servers may infer this from the endpoint the client submits requests to.
	// Cannot be updated.
	// In CamelCase.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"`

	// APIVersion defines the versioned schema of this representation of an object.
	// Servers should convert recognized schemas to the latest internal value, and
	// may reject unrecognized values.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources
	// +optional
	APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,2,opt,name=apiVersion"`
}

type User

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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