Documentation ¶
Index ¶
- Constants
- type Client
- type ClientStatus
- type Container
- type DBContainer
- type DBImage
- type DBService
- type DockerComposeFile
- type DockerComposeFileNetwork
- type DockerComposeFileNetworkIPAM
- type DockerComposeFileNetworkIPAMConfig
- type DockerComposeFileService
- type DockerComposeFileServiceNetwork
- type Image
- type KisaraNetworkMonitorContainer
- type KisaraNetworkMonitorImage
- type KisaraNetworkTest
- type KisaraNetworkTestResult
- type KisaraNetworkTestResultSet
- type KisaraNetworkTestSet
- type KisaraResponse
- type KisaraResponseWrap
- type KisaraService
- type KisaraVMImage
- type KisaraVmLimit
- type KisaraVmNetwork
- type Network
- type RequestCheckLaunchService
- type RequestCheckLaunchStatus
- type RequestCheckLaunchVm
- type RequestCheckPullImage
- type RequestCheckStopService
- type RequestConnect
- type RequestCreateNetwork
- type RequestDeleteImage
- type RequestDisconnect
- type RequestExecContainer
- type RequestHeartBeat
- type RequestInspectContainer
- type RequestLaunchContainer
- type RequestLaunchService
- type RequestLaunchVm
- type RequestListContainer
- type RequestListImage
- type RequestListNetwork
- type RequestListService
- type RequestListVm
- type RequestNetworkMonitorCheck
- type RequestNetworkMonitorRun
- type RequestNetworkMonitorRunScript
- type RequestNetworkMonitorRunToByRecieved
- type RequestNetworkMonitorStop
- type RequestPullImage
- type RequestRemoveContainer
- type RequestRemoveNetwork
- type RequestStatus
- type RequestStopContainer
- type RequestStopService
- type ResponseCheckLaunchService
- type ResponseCheckLaunchStatus
- type ResponseCheckLaunchVm
- type ResponseCheckPullImage
- type ResponseCheckStopService
- type ResponseConnect
- type ResponseCreateNetwork
- type ResponseDeleteImage
- type ResponseDisconnect
- type ResponseExecContainer
- type ResponseFinalLaunchServiceStatus
- type ResponseFinalLaunchStatus
- type ResponseFinalLaunchVmStatus
- type ResponseFinalNetworkMonitorStatus
- type ResponseFinalPullImageStatus
- type ResponseHeartBeat
- type ResponseInspectContainer
- type ResponseLaunchContainer
- type ResponseLaunchService
- type ResponseLaunchVm
- type ResponseListContainer
- type ResponseListImage
- type ResponseListNetwork
- type ResponseListService
- type ResponseListVm
- type ResponseNetworkMonitorCheck
- type ResponseNetworkMonitorRun
- type ResponseNetworkMonitorRunScript
- type ResponseNetworkMonitorStop
- type ResponsePullImage
- type ResponseRemoveContainer
- type ResponseRemoveNetwork
- type ResponseStatus
- type ResponseStopContainer
- type ResponseStopService
- type Server
- type Service
- type ServiceConfig
- type ServiceConfigContainer
- type ServiceConfigContainerFlag
- type ServiceConfigContainerNetwork
- type ServiceConfigContainerPortMapping
- type ServiceFlag
- type VM
Constants ¶
View Source
const ( KISARA_VM_NET_TYPE_HOST = "host" KISARA_VM_NET_TYPE_NAT = "nat" )
View Source
const ( KISARA_VM_LIMIT_BYTES = 1 KISARA_VM_LIMIT_KB = 1024 * KISARA_VM_LIMIT_BYTES KISARA_VM_LIMIT_MB = 1024 * KISARA_VM_LIMIT_KB KISARA_VM_LIMIT_GB = 1024 * KISARA_VM_LIMIT_MB KISARA_VM_LIMIT_TB = 1024 * KISARA_VM_LIMIT_GB )
View Source
const ( KISARA_VM_ARCH_X86_64 = "x86_64" KISARA_VM_ARCH_X86 = "x86" KISARA_VM_ARCH_ARM = "arm" KISARA_VM_ARCH_ARM64 = "arm64" KISARA_VM_ARCH_MIPS = "mips" KISARA_VM_ARCH_MIPS64 = "mips64" KISARA_VM_ARCH_MIPS64LE = "mips64le" KISARA_VM_ARCH_MIPSLE = "mipsle" // based on docker KISARA_VM_TYPE_QEMU = "qemu" KISARA_VM_TYPE_KVM = "kvm" KISARA_VM_TYPE_LXC = "lxc" KISARA_VM_TYPE_LXD = "lxd" )
View Source
const ( KISARA_VM_STATUS_RUNNING = "running" KISARA_VM_STATUS_STOPPED = "stopped" )
View Source
const (
SERVICE_STATUS_RUNNING = "running"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // ClientIp ClientIp string `json:"client_ip"` // ClientPort ClientPort int `json:"client_port"` // Token ClientToken string `json:"client_token"` }
func (*Client) GenerateClientURI ¶
type ClientStatus ¶
type ClientStatus struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // CPUUsage is the CPU usage of the client CPUUsage float64 `json:"cpu_usage"` // MemoryUsage is the memory usage of the client MemoryUsage float64 `json:"memory_usage"` // DiskUsage is the disk usage of the client DiskUsage float64 `json:"disk_usage"` // NetworkUsage is the network usage of the client NetworkUsage float64 `json:"network_usage"` // ContainerNum is the number of containers of the client ContainerNum int `json:"container_num"` // ContainerUsage is the usage of containers of the client ContainerUsage float64 `json:"container_usage"` }
type Container ¶
type Container struct { Id string `json:"id"` Image string `json:"image"` Uuid string `json:"uuid"` Time int `json:"time"` Owner int `json:"owner"` HostPort string `json:"host_port"` Labels map[string]string `json:"labels"` Status string `json:"status"` CPUUsage float64 `json:"cpu_usage"` MemUsage float64 `json:"mem_usage"` Networks []Network `json:"networks"` }
type DBContainer ¶
type DBContainer struct { gorm.Model Id int `gorm:"primaryKey;autoIncrement;not null"` ContainerName string `gorm:"type:varchar(255);not null"` ContainerId string `gorm:"type:varchar(255);not null;unique;index"` Labels string `gorm:"type:varchar(2048);not null"` Image string `gorm:"type:varchar(255);not null"` Uid int `gorm:"type:int;not null"` }
type DBImage ¶
type DBService ¶
type DBService struct { gorm.Model Id int `gorm:"primaryKey;autoIncrement;not null"` ServiceName string `gorm:"type:varchar(255);not null"` ServiceId string `gorm:"type:varchar(255);not null;unique;index"` Containers string `gorm:"type:varchar(2048);not null"` Networks string `gorm:"type:varchar(2048);not null"` Flags string `gorm:"type:varchar(2048);not null"` }
func (*DBService) GetService ¶
func (*DBService) InjectService ¶
type DockerComposeFile ¶
type DockerComposeFile struct { Services map[string]DockerComposeFileService `yaml:"services"` Networks map[string]DockerComposeFileNetwork `yaml:"networks"` Volumes map[string]struct{} `yaml:"volumes"` }
func (*DockerComposeFile) FromYaml ¶
func (c *DockerComposeFile) FromYaml(text string) error
func (*DockerComposeFile) ToYaml ¶
func (c *DockerComposeFile) ToYaml() string
type DockerComposeFileNetwork ¶
type DockerComposeFileNetwork struct {
IPAM DockerComposeFileNetworkIPAM `yaml:"ipam"`
}
type DockerComposeFileNetworkIPAM ¶
type DockerComposeFileNetworkIPAM struct { Driver string `yaml:"driver"` Attachable bool `yaml:"attachable"` Internal bool `yaml:"internal"` Config []DockerComposeFileNetworkIPAMConfig `yaml:"config"` }
type DockerComposeFileNetworkIPAMConfig ¶
type DockerComposeFileNetworkIPAMConfig struct {
Subnet string `yaml:"subnet"`
}
type DockerComposeFileService ¶
type DockerComposeFileService struct { Image string `yaml:"image"` Build string `yaml:"build"` Networks map[string]DockerComposeFileServiceNetwork `yaml:"networks"` Ports []string `yaml:"ports"` }
type KisaraNetworkMonitorContainer ¶
type KisaraNetworkMonitorContainer struct {
ContainerId string `json:"container_id"`
}
type KisaraNetworkMonitorImage ¶
type KisaraNetworkMonitorImage struct {
ImageName string `json:"image_name"`
}
type KisaraNetworkTest ¶
type KisaraNetworkTest struct { // The container to be tested ContainerId string `json:"container_id"` // The container to test TestContainerId string `json:"test_container_id"` // The test cmd like "python3 test.py $ip", the $ip will be replaced by the container's ip Script string `json:"script"` }
type KisaraNetworkTestResult ¶
type KisaraNetworkTestResultSet ¶
type KisaraNetworkTestResultSet struct {
Results []KisaraNetworkTestResult `json:"results"`
}
type KisaraNetworkTestSet ¶
type KisaraNetworkTestSet struct {
Containers []KisaraNetworkTest `json:"containers"`
}
type KisaraResponse ¶
type KisaraResponse struct { // Code is the code of the response Code int `json:"code"` // Message is the message of the response Message string `json:"message"` // Data is the data of the response Data interface{} `json:"data"` }
func ErrorResponse ¶
func ErrorResponse(code int, message string) KisaraResponse
func SuccessResponse ¶
func SuccessResponse(data interface{}) KisaraResponse
type KisaraResponseWrap ¶
type KisaraService ¶
type KisaraService struct { Id string `json:"id"` Name string `json:"name"` Description string `json:"description"` Owner int `json:"owner"` Config string `json:"config"` // json string of service config }
Service is not the service in docker compose, it is the service config in kisara
func (*KisaraService) GetConfig ¶
func (c *KisaraService) GetConfig() (ServiceConfig, error)
type KisaraVMImage ¶
type KisaraVMImage struct { // Id of the VM image Id string `json:"id"` // Image name Image string `json:"image"` // Image tag Tag string `json:"tag"` // architecture Arch string `json:"arch"` // Type of VM Type string `json:"type"` // Base qemu image BaseImage string `json:"base_image"` // Image size Size int64 `json:"size"` // created time Created int64 `json:"created"` // Require resource Limit KisaraVmLimit `json:"limit"` // checksum Checksum string `json:"checksum"` // sha256 }
type KisaraVmLimit ¶
type KisaraVmNetwork ¶
type RequestCheckLaunchService ¶
type RequestCheckLaunchService struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // RequestID is the request ID of the container MessageResponseId string `json:"response_id" form:"response_id" binding:"required"` // FinishResponseID is the finish response ID of the container FinishResponseID string `json:"finish_response_id" form:"finish_response_id" binding:"required"` }
type RequestCheckLaunchVm ¶
type RequestCheckLaunchVm struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // RequestID is the request ID of the container MessageResponseId string `json:"response_id" form:"response_id" binding:"required"` // FinishResponseID is the finish response ID of the container FinishResponseID string `json:"finish_response_id" form:"finish_response_id" binding:"required"` }
type RequestCheckPullImage ¶
type RequestCheckPullImage struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // func HandleControllerRequestCheckPullImage(request_id string) // RequestID is the request ID of the container MessageResponseId string `json:"message_resposne_id" form:"message_resposne_id" binding:"required"` // FinishResponseID is the finish response ID of the container FinishResponseID string `json:"finish_response_id" form:"finish_response_id" binding:"required"` }
type RequestCheckStopService ¶
type RequestConnect ¶
type RequestConnect struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // ClientIp ClientIp string `json:"client_ip" form:"client_ip" binding:"required"` // ClientPort ClientPort int `json:"client_port" form:"client_port" binding:"required"` // callback Callback func(ResponseConnect) `json:"-"` }
type RequestCreateNetwork ¶
type RequestCreateNetwork struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // func (c *Docker) CreateNetwork(subnet string, name string, host_join bool) error // Subnet is the subnet of the container Subnet string `json:"subnet" form:"subnet" binding:"required"` // Name is the name of the container Name string `json:"name" form:"name" binding:"required"` // Internal is the host join of the container Internal bool `json:"internal" form:"internal" binding:"required"` // Driver Driver string `json:"driver" form:"driver" binding:"required"` }
type RequestDeleteImage ¶
type RequestDeleteImage struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // func (c *Docker) DeleteImage(image_id string) error // ImageID is the image ID of the container ImageID string `json:"image_id" form:"image_id" binding:"required"` }
type RequestDisconnect ¶
type RequestDisconnect struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` }
type RequestExecContainer ¶
type RequestExecContainer struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // func (c *Docker) Exec(container_id string, cmd string) error // ContainerID is the container ID of the container ContainerID string `json:"container_id" form:"container_id" binding:"required"` // Cmd is the cmd of the container Cmd string `json:"cmd" form:"cmd" binding:"required"` }
type RequestHeartBeat ¶
type RequestHeartBeat struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` }
type RequestInspectContainer ¶
type RequestInspectContainer struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // func (c *Docker) InspectContainer(container_id string, has_state ...bool) (*kisara_types.Container, error) // ContainerID is the container ID of the container ContainerIDs []string `json:"container_id" form:"container_id" binding:"required"` // HasState is the has state of the container HasState bool `json:"has_state" form:"has_state" binding:"required"` }
type RequestLaunchContainer ¶
type RequestLaunchContainer struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // func (c *Docker) CreateContainer(image *Image, uid int, port_protocol string, subnet_name string, module string, env_mount ...map[string]string) (*Container, error) // Image is the image of the container Image string `json:"image" form:"image" binding:"required"` // UID is the uid of the container UID int `json:"uid" form:"uid"` // PortProtocol is the port protocol of the container PortProtocol string `json:"port_protocol" form:"port_protocol"` // SubnetName is the subnet name of the container SubnetName string `json:"subnet_name" form:"subnet_name" binding:"required"` // Module is the module of the container Module string `json:"module" form:"module"` // EnvMount is the env mount of the container EnvMount []map[string]string `json:"env_mount" form:"env_mount"` }
type RequestLaunchService ¶
type RequestLaunchService struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // ServiceConfig ServiceConfig KisaraService `json:"service_config" form:"service_config" binding:"required"` }
type RequestLaunchVm ¶
type RequestLaunchVm struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // Vm id ImageId string `json:"image_id" form:"image_id" binding:"required"` // Cpu limit CpuLimit int `json:"cpu_limit" form:"cpu_limit" binding:"required"` // Memory limit MemoryLimit int `json:"memory_limit" form:"memory_limit" binding:"required"` // Disk limit DiskLimit int `json:"disk_limit" form:"disk_limit" binding:"required"` // Network limit NetworkLimit int `json:"network_limit" form:"network_limit" binding:"required"` // NetworkNames is the network names of the container, vm will be connected to these networks if they exist, otherwise, error will be returned NetworkNames []string `json:"network_names" form:"network_names" binding:"required"` }
request to launch a vm, with the vm image id, cpu limit, memory limit, disk limit, network limit if limit is 0, it's unlimited
type RequestListContainer ¶
type RequestListContainer struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` }
type RequestListImage ¶
type RequestListImage struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` }
type RequestListNetwork ¶
type RequestListNetwork struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` }
type RequestListService ¶
type RequestListService struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` }
type RequestListVm ¶
type RequestListVm struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` }
type RequestNetworkMonitorCheck ¶
type RequestNetworkMonitorCheck struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // Response Id ResponseId string `json:"response_id" form:"response_id" binding:"required"` // FinishResponseID is the finish response ID of the container FinishResponseID string `json:"finish_response_id" form:"finish_response_id" binding:"required"` }
type RequestNetworkMonitorRun ¶
type RequestNetworkMonitorRun struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // context Context io.Reader `json:"context" form:"context"` // NetworkName NetworkName string `json:"network_name" form:"network_name" binding:"required"` }
send request
type RequestNetworkMonitorRunScript ¶
type RequestNetworkMonitorRunScript struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // Containers to be tested Containers KisaraNetworkTestSet `json:"containers" form:"containers" binding:"required"` }
type RequestNetworkMonitorRunToByRecieved ¶
type RequestNetworkMonitorRunToByRecieved struct { // ClientID is the unique ID of the client ClientID string `form:"client_id" binding:"required"` // context Context *multipart.FileHeader `form:"file" binding:"required"` // NetworkName NetworkName string `form:"network_name" binding:"required"` }
parsed request
type RequestNetworkMonitorStop ¶
type RequestNetworkMonitorStop struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // NetworkMonitor Container Id NetworkMonitorContainerId string `json:"network_monitor_container_id" form:"network_monitor_container_id" binding:"required"` }
type RequestPullImage ¶
type RequestPullImage struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // func HandleControllerRequestPullImage(request_id string, image_name string, port_protocol string, user string) // ImageName is the image name of the container ImageName string `json:"image_name" form:"image_name" binding:"required"` // PortProtocol is the port protocol of the container PortProtocol string `json:"port_protocol" form:"port_protocol" binding:"required"` // User is the user of the container User string `json:"user" form:"user" binding:"required"` }
type RequestRemoveContainer ¶
type RequestRemoveNetwork ¶
type RequestRemoveNetwork struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // func (c *Docker) RemoveNetwork(network_id string) error // NetworkID is the network ID of the container NetworkID string `json:"network_id" form:"network_id" binding:"required"` }
type RequestStatus ¶
type RequestStatus struct { // ClientID is the unique ID of the client ClientID string `json:"client_id" form:"client_id" binding:"required"` // CPUUsage is the CPU usage of the client CPUUsage float64 `json:"cpu_usage" form:"cpu_usage" binding:"required"` // MemoryUsage is the memory usage of the client MemoryUsage float64 `json:"memory_usage" form:"memory_usage" binding:"required"` // DiskUsage is the disk usage of the client DiskUsage float64 `json:"disk_usage" form:"disk_usage" binding:"required"` // NetworkUsage is the network usage of the client NetworkUsage float64 `json:"network_usage" form:"network_usage" binding:"required"` // ContainerNum is the number of containers of the client ContainerNum int `json:"container_num" form:"container_num" binding:"required"` // ContainerUsage is the usage of containers of the client ContainerUsage float64 `json:"container_usage" form:"container_usage" binding:"required"` }
type RequestStopContainer ¶
type RequestStopService ¶
type ResponseCheckLaunchService ¶
type ResponseCheckLaunchService struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // Error is the error of the container Error string `json:"error"` // Finished is the finished of the container Finished bool `json:"finished"` // Message Message string `json:"message"` // Service Service Service `json:"service"` }
type ResponseCheckLaunchStatus ¶
type ResponseCheckLaunchStatus struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // ContainerID is the container ID of the container Container Container // Error is the error of the container Error string `json:"error"` // Finished Finished bool `json:"finished"` }
type ResponseCheckLaunchVm ¶
type ResponseCheckPullImage ¶
type ResponseCheckPullImage struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // Error is the error of the container Error string `json:"error"` // Finished is the finished of the container Finished bool `json:"finished"` // RequestID is the request ID of the container Message string `json:"message"` }
type ResponseConnect ¶
type ResponseCreateNetwork ¶
type ResponseDeleteImage ¶
type ResponseDisconnect ¶
type ResponseDisconnect struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` }
type ResponseExecContainer ¶
type ResponseHeartBeat ¶
type ResponseLaunchContainer ¶
type ResponseLaunchService ¶
type ResponseLaunchService struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // Error is the error of the container Error string `json:"error"` // Service MessageResponseId string `json:"response_id"` // FinishResponseID is the finish response ID of the container FinishResponseID string `json:"finish_response_id"` }
type ResponseLaunchVm ¶
type ResponseLaunchVm struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // Error is the error of the vm Error string `json:"error"` // Vm MessageResponseId string `json:"response_id"` // FinishResponseID is the finish response ID of the container FinishResponseID string `json:"finish_response_id"` }
type ResponseListContainer ¶
type ResponseListImage ¶
type ResponseListNetwork ¶
type ResponseListService ¶
type ResponseListVm ¶
type ResponseNetworkMonitorCheck ¶
type ResponseNetworkMonitorCheck struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // Error is the error of the run Error string `json:"error"` // Finished is the finished of the run Finished bool `json:"finished"` // Message Message string `json:"message"` // NetworkMonitor Container Id NetworkMonitorContainerId string `json:"network_monitor_container_id"` }
type ResponseNetworkMonitorRun ¶
type ResponseNetworkMonitorRun struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // Error is the error of the vm Error string `json:"error"` // Response Id ResponseId string `json:"response_id"` // FinishResponseID is the finish response ID of the container FinishResponseID string `json:"finish_response_id"` }
type ResponseNetworkMonitorRunScript ¶
type ResponseNetworkMonitorRunScript struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // Error is the error of the run Error string `json:"error"` // Containers to be tested Result KisaraNetworkTestResultSet `json:"result"` }
type ResponsePullImage ¶
type ResponsePullImage struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` // Error is the error of the container Error string `json:"error"` // RequestID is the request ID of the container MessageResponseId string `json:"message_resposne_id"` // FinishResponseID is the finish response ID of the container FinishResponseID string `json:"finish_response_id"` }
type ResponseRemoveContainer ¶
type ResponseRemoveNetwork ¶
type ResponseStatus ¶
type ResponseStatus struct { // ClientID is the unique ID of the client ClientID string `json:"client_id"` }
type ResponseStopContainer ¶
type ResponseStopService ¶
type Service ¶
type Service struct { Id string `json:"id"` Name string `json:"name"` Containers []Container `json:"containers"` Networks []Network `json:"networks"` Flags []ServiceFlag `json:"flags"` Status string `json:"status"` }
Service is the service kisara generated for the user
type ServiceConfig ¶
type ServiceConfig struct { Containers []ServiceConfigContainer `json:"containers" yaml:"containers"` TotalScore int `json:"total_score" yaml:"total_score"` NetworkCount int `json:"network_count" yaml:"network_count"` ContainerCount int `json:"container_count" yaml:"container_count"` }
func (*ServiceConfig) FromYaml ¶
func (c *ServiceConfig) FromYaml(text_config string) error
func (*ServiceConfig) GetFlagCount ¶
func (c *ServiceConfig) GetFlagCount() int
func (*ServiceConfig) GetNetworks ¶
func (c *ServiceConfig) GetNetworks() []ServiceConfigContainerNetwork
func (*ServiceConfig) RandomCIDRCount ¶
func (c *ServiceConfig) RandomCIDRCount() int
func (*ServiceConfig) ToYaml ¶
func (c *ServiceConfig) ToYaml() string
type ServiceConfigContainer ¶
type ServiceConfigContainer struct { Image string `json:"image" yaml:"image"` Ports []ServiceConfigContainerPortMapping `json:"ports" yaml:"ports"` Networks []ServiceConfigContainerNetwork `json:"networks" yaml:"networks"` Flags []ServiceConfigContainerFlag `json:"flags" yaml:"flags"` Env map[string]string `json:"env" yaml:"env"` }
func (*ServiceConfigContainer) GetPortProtocol ¶
func (c *ServiceConfigContainer) GetPortProtocol() map[int]string
func (*ServiceConfigContainer) GetPortProtocolText ¶
func (c *ServiceConfigContainer) GetPortProtocolText() string
type ServiceFlag ¶
ServiceFlag Contains the flag kisara generated for the service, it's not the part of service config
type VM ¶
type VM struct { // VM name Name string `json:"name"` // base image ImageId string `json:"image_id"` // VM type Type string `json:"type"` // VM arch Arch string `json:"arch"` // VM status Status string `json:"status"` // VM created time Created int64 `json:"created"` // Base container id BaseContainerId string `json:"base_container_id"` // VM id Id string `json:"id"` // Limit of VM Limit KisaraVmLimit `json:"limit"` // Network Network []KisaraVmNetwork `json:"network"` }
Click to show internal directories.
Click to hide internal directories.