api

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

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

func NewApi

func NewApi(controller *Controller, log *logrus.Logger, cfg *config.Config) *Api

func (Api) Start

func (a Api) Start()

type Controller

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

func NewController

func NewController(serverService ServerService, log *logrus.Logger) *Controller

func (*Controller) CreateHosting

func (c *Controller) CreateHosting(w http.ResponseWriter, r *http.Request)

func (*Controller) GetHostings

func (c *Controller) GetHostings(w http.ResponseWriter, r *http.Request)

func (*Controller) Health

func (c *Controller) Health(w http.ResponseWriter, r *http.Request)

func (*Controller) RemoveHosting

func (c *Controller) RemoveHosting(w http.ResponseWriter, r *http.Request)

func (*Controller) UpdateHosting

func (c *Controller) UpdateHosting(w http.ResponseWriter, r *http.Request)

type CreateHostingRq

type CreateHostingRq struct {
	domain.Hosting
}

type CreateHostingRs

type CreateHostingRs struct {
	UUID   string `json:"uuid,omitempty"`
	ErrMsg string `json:"error,omitempty"`
}

type GetHostingsRs

type GetHostingsRs struct {
	Hostings []domain.Hosting
	ErrMsg   string `json:"error,omitempty"`
}

type HealthRs

type HealthRs struct {
	RunningTime  string `json:"running_time"`
	ServerStatus *domain.Server
}

type RemoveHostingRs

type RemoveHostingRs struct {
	UUID   string `json:"uuid,omitempty"`
	ErrMsg string `json:"error,omitempty"`
}

type ServerService

type ServerService interface {
	CreateHosting(name string, cores int, memorymb int, diskmb int) (domain.UUID, error)
	GetHostings() ([]domain.Hosting, error)
	RemoveHosting(uuid domain.UUID) error
	UpdateHosting(hosting *domain.Hosting) error
	GetServerStatus() *domain.Server
}

type UpdateHostingRq

type UpdateHostingRq struct {
	domain.Hosting
}

type UpdateHostingRs

type UpdateHostingRs struct {
	UUID   string `json:"uuid,omitempty"`
	ErrMsg string `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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