models

package
v0.0.0-...-2c87c15 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Objects map[string]*Object
)
View Source
var (
	UserList map[string]*User
)

Functions

func AddOne

func AddOne(object Object) (ObjectId string)

func AddUser

func AddUser(u User) string

func Delete

func Delete(ObjectId string)

func DeleteUser

func DeleteUser(uid string)

func GetAll

func GetAll() map[string]*Object

func GetAllUsers

func GetAllUsers() map[string]*User

func Login

func Login(username, password string) bool

func Update

func Update(ObjectId string, Score int64) (err error)

Types

type AdminLogin

type AdminLogin struct {
	Code int64 `json:"code"`
	Data struct {
		Token  string   `json:"token"`
		Roles  []string `json:"roles"`
		Name   string   `json:"name"`
		Avatar string   `json:"avatar"`
	} `json:"data"`
}

func (*AdminLogin) GetInfo

func (this *AdminLogin) GetInfo() (*AdminLogin, error)

type AdminUser

type AdminUser struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

func (*AdminUser) GetToken

func (this *AdminUser) GetToken() (*AdminLogin, error)

type Client

type Client struct {
	Result int
	Times  string
}

type ConfigmapsJson

type ConfigmapsJson struct {
	Data        map[string]string `json:"data"`
	Name        string            `json:"name"`
	Namespace   string            `json:"namespace"`
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
}

type Default

type Default struct {
	Cpu     string `json:"cpu"`
	Memory  string `json:"memory"`
	Storage string `json:"storage"`
}

type DefaultRequest

type DefaultRequest struct {
	Cpu     string `json:"cpu"`
	Memory  string `json:"memory"`
	Storage string `json:"storage"`
}

type Domain

type Domain struct {
	Terminating    string `json:"Terminating"`
	NotTerminating string `json:"NotTerminating"`
	BestEffort     string `json:"BestEffort"`
	NotBestEffort  string `json:"NotBestEffort"`
}

type DynamicPVC

type DynamicPVC struct {
	Name      string   `json:"name"`
	Namespace string   `json:"namespace"`
	Region    []string `json:"region"`
	Size      int64    `json:"size"`
	Storage   string   `json:"storage"`
	Unit      string   `json:"unit"`
	MaxSize   int64    `json:"maxsize"`
}

type HarborUsers

type HarborUsers struct {
	Uername        string `json:"username"`
	Email          string `json:"email"`
	Comment        string `json:"comment"`
	Password       string `json:"password"`
	Realname       string `json:"realname"`
	Has_admin_role int64  `json:"has_admin_role"`
}

type LimitRange

type LimitRange struct {
	apiv1.LimitRange
}

type LimitRangeList

type LimitRangeList struct {
	apiv1.LimitRangeList
}

type LimitRanged

type LimitRanged struct {
	Metadata Metadata `json:"metadata"`
	Spec     Spec     `json:"spec"`
}

func (*LimitRanged) Resolved

func (this *LimitRanged) Resolved() *apiv1.LimitRange

func (*LimitRanged) Unmarshal

func (this *LimitRanged) Unmarshal(data []byte) error

type Limits

type Limits struct {
	Type                 string         `json:"type"`
	Max                  Max            `json:"max"`
	Min                  Min            `json:"min"`
	Default              Default        `json:"default"`
	DefaultRequest       DefaultRequest `json:"defaultRequest"`
	MaxLimitRequestRatio string         `json:"maxLimitRequestRatio"`
}

type Max

type Max struct {
	Cpu     string `json:"cpu"`
	Memory  string `json:"memory"`
	Storage string `json:"storage"`
}

type Metadata

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

type Min

type Min struct {
	Cpu     string `json:"cpu"`
	Memory  string `json:"memory"`
	Storage string `json:"storage"`
}

type Namespace

type Namespace struct {
	Name string
}

type Namespaces

type Namespaces struct {
	Names []string `json:"name"`
}

mutil Names for delete

type NodeLabels

type NodeLabels struct {
	Node      string            `json:"node"`
	Value     map[string]string `json:"values"`
	Overwrite bool              `json:"overwrite"`
}

type Object

type Object struct {
	ObjectId   string
	Score      int64
	PlayerName string
}

func GetOne

func GetOne(ObjectId string) (object *Object, err error)

type Objected

type Objected struct {
	Configmaps             string `json:"configmaps"`
	Pods                   string `json:"pods"`
	ReplicationControllers string `json:"replicationcontrollers"`
	ResourceQuotas         string `json:"resourcequotas"`
	Services               string `json:"services"`
	ServicesLoadbalances   string `json:"servicesLoadbalances"`
	ServicesNodeports      string `json:"servicesNodeports"`
	Secrets                string `json:"secrets"`
	Persistentvolumeclaims string `json:"persistentvolumeclaims"`
}

type Profile

type Profile struct {
	Gender  string
	Age     int
	Address string
	Email   string
}

type Resource

type Resource struct {
	Cpu            string `json:"cpu"`
	Memory         string `json:"memory"`
	LimitsCpu      string `json:"limitsCpu"`
	LimitsMemory   string `json:"limitsMemory"`
	RequestsCpu    string `json:"requestsCpu"`
	RequestsMemory string `json:"requestsMemory"`
	NvidiaGpu      string `json:"gpu"`
}

type ResourceQuota

type ResourceQuota struct {
	Name      string   `json:"name"`
	Namespace string   `json:"namespace"`
	Resource  Resource `json:"resource"`
	Storage   Storage  `json:"storage"`
	Objected  Objected `json:"object"`
	Domain    Domain   `json:"domain"`
}

type Secrets

type Secrets struct{}

type Service

type Service struct {
	Name        string        `json:"name"`
	Namespace   string        `json:"namespace"`
	Type        string        `json:"type"`
	ServicePods []ServicePods `json:"servicePods"`
	Tag         []string      `json:"tag"`
	ClusetIP    string        `json:"clusterip"`
	Ingressip   string        `json:"ingressip"`
	LoadIp      string        `json:"loadip"`
	Method      string        `json:"method"` //  patch add or delete
}

type ServicePods

type ServicePods struct {
	Index      int64  `json:"index"`
	NodePort   string `json:"nodeport"`
	Port       string `json:"port"`
	Portname   string `json:"portname"`
	Protocol   string `json:"protocol"`
	TargetPort string `json:"targetport"`
}

type Spec

type Spec struct {
	Limits []Limits `json:"limits"`
}

type Storage

type Storage struct {
	RequestsStorage                    string `json:"requestsStorage"`
	Persistentvolumeclaims             string `json:"persistentvolumeclaims"`
	StorageClassRequestsStorage        string `json:"requestsStorageClass"`
	StorageClassPersistentvolumeclaims string `json:"persistentvolumeclaimsClass"`
}

type User

type User struct {
	Id       string
	Username string
	Password string
	Profile  Profile
}

func GetUser

func GetUser(uid string) (u *User, err error)

func UpdateUser

func UpdateUser(uid string, uu *User) (a *User, err error)

Jump to

Keyboard shortcuts

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