domain

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

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

Go to latest
Published: Feb 14, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hosting

type Hosting struct {
	UUID     UUID   `json:"uuid"`
	Name     string `json:"name"`
	Cores    int    `json:"cores"`
	MemoryMb int    `json:"memorymb"`
	DiskMb   int    `json:"diskmb"`
}

func NewHosting

func NewHosting(name string, cores, memorymb, diskmb int) (*Hosting, error)

func (*Hosting) Validate

func (h *Hosting) Validate(cfg *config.Config) (err error)

type Server

type Server struct {
	sync.Mutex
	UUID                    UUID `json:"uuid"`
	TotalCores              int  `json:"total_cores"`
	TotalSizeOfMemoryMb     int  `json:"total_memory_mb"`
	TotalSizeOfDiskMb       int  `json:"total_disk_mb"`
	AvailableCores          int  `json:"available_cores"`
	AvailableSizeOfMemoryMb int  `json:"available_memory_mb"`
	AvailableSizeOfDiskMb   int  `json:"available_disk_mb`
}

func NewServer

func NewServer(cfg *config.Config) (*Server, error)

func (*Server) AddHosting

func (s *Server) AddHosting(hosting *Hosting, cfg *config.Config) error

func (*Server) RemoveHosting

func (s *Server) RemoveHosting(hosting *Hosting) error

func (*Server) UpdateHosting

func (s *Server) UpdateHosting(hosting, old *Hosting, cfg *config.Config) error

type UUID

type UUID string

func (UUID) Validate

func (u UUID) Validate() error

Jump to

Keyboard shortcuts

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