v1alpha1

package
v0.0.0-...-ded32d3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	StatusOn  = "on"
	StatusOff = "off"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	ID      int64     `json:"id"      form:"id"         xorm:"pk autoincr 'id'"`
	Name    string    `json:"name"    form:"name"       xorm:"name"`
	Created time.Time `json:"created"                   xorm:"created"`
	Updated time.Time `json:"updated"                   xorm:"updated"`
	Deleted time.Time `json:"deleted"                   xorm:"deleted"`
}

Application defines application info.

type ApplicationResource

type ApplicationResource struct {
	ID                int64                `json:"id"`
	Name              string               `json:"name"`
	ContainerResource []*ContainerResource `json:"container_resource"`
}

type ApplicationStore

type ApplicationStore interface {
	// Application CRUD
	CreateApplication(application *Application) error

	GetApplication(name string) (*Application, error)

	ListApplication() ([]*Application, error)

	UpdateApplication(application *Application) error

	DeleteApplication(application *Application) error
}

type ContainerResource

type ContainerResource struct {
	ID                     int64     `json:"id"                             xorm:"pk autoincr 'id'"`
	Name                   string    `json:"name"                           xorm:"name"`
	ApplicationID          int64     `json:"application_id"                 xorm:"application_id"`
	TimeframeID            int64     `json:"timeframe_id"                   xorm:"timeframe_id"`
	CPULimit               int64     `json:"cpu_limit"                      xorm:"cpu_limit"`
	MemoryLimit            int64     `json:"memory_limit"                   xorm:"memory_limit"`
	DiskReadIOLimit        int64     `json:"disk_read_io_limit"             xorm:"disk_read_io_limit"`
	DiskWriteIOLimit       int64     `json:"disk_write_io_limit"            xorm:"disk_write_io_limit"`
	NetworkReceiveIOLimit  int64     `json:"network_receive_io_limit"       xorm:"network_receive_io_limit"`
	NetworkTransmitIOLimit int64     `json:"network_transmit_io_limit"      xorm:"network_transmit_io_limit"`
	Created                time.Time `json:"created"                        xorm:"created"`
	Updated                time.Time `json:"updated"                        xorm:"updated"`
}

ContainerResource defines container of application resource

type RecommendResourceStore

type RecommendResourceStore interface {
	// RecommendResource CRUD
	GetApplicationResource(name string) (*ApplicationResource, error)

	DeleteApplicationResource(name string) error

	DeleteTimeframeResource(name string) error

	ListApplicationResource() ([]*ApplicationResource, error)

	AddOrUpdateContainerResource(resource []*ContainerResource) error

	ListTimeframeApplicationResource(name string) ([]*ApplicationResource, error)

	GetTimeframeApplicationResource(name, appName string) (*ApplicationResource, error)
}

RecommendResourceStore defines store RecommendResource

type StatusName

type StatusName string

type Timeframe

type Timeframe struct {
	ID          int64     `json:"id"                  xorm:"pk autoincr 'id'"`
	Name        string    `json:"name"                xorm:"name"`
	Start       time.Time `json:"start"               xorm:"start"`
	End         time.Time `json:"end"                 xorm:"end"`
	Status      string    `json:"status"              xorm:"status"`
	Description string    `json:"description"         xorm:"description"`
	Created     time.Time `json:"created"             xorm:"created"`
	Updated     time.Time `json:"updated"             xorm:"updated"`
	Deleted     time.Time `json:"deleted"             xorm:"deleted"`
}

Timeframe defines query time frame

type TimeframeStore

type TimeframeStore interface {
	// Timeframe CRUD
	CreateTimeframe(frame *Timeframe) error

	GetTimeframe(name string) (*Timeframe, error)

	ListTimeframe() ([]*Timeframe, error)

	UpdateTimeframe(frame *Timeframe) error

	UpdateTimeframes(frame []*Timeframe) error

	DeleteTimeframe(frame *Timeframe) error
}

Jump to

Keyboard shortcuts

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