app

package
v0.0.0-...-9f1a7a8 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPlanNotFound         = errors.New("plan not found")
	ErrPlanAlreadyExists    = errors.New("plan already exists")
	ErrPlanDefaultAmbiguous = errors.New("more than one default plan found")
	ErrPlanDefaultNotFound  = errors.New("default plan not found")
	ErrLimitOfCpuShare      = errors.New("The minimum allowed cpu-shares is 2")
	ErrLimitOfMemory        = errors.New("The minimum allowed memory is 4MB")
)
View Source
var (
	ErrPlatformNameMissing    = errors.New("Platform name is required.")
	ErrPlatformNotFound       = errors.New("Platform doesn't exist.")
	ErrDuplicatePlatform      = errors.New("Duplicate platform")
	ErrInvalidPlatform        = errors.New("Invalid platform")
	ErrDeletePlatformWithApps = errors.New("Platform has apps. You should remove them before remove the platform.")
	ErrInvalidPlatformName    = &tsuruErrors.ValidationError{
		Message: "Invalid platform name, should have at most 63 " +
			"characters, containing only lower case letters, numbers or dashes, " +
			"starting with a letter.",
	}
)

Functions

This section is empty.

Types

type AppRouter

type AppRouter struct {
	Name         string            `json:"name"`
	Opts         map[string]string `json:"opts"`
	Address      string            `json:"address" bson:"-"`
	Type         string            `json:"type" bson:"-"`
	Status       string            `json:"status,omitempty" bson:"-"`
	StatusDetail string            `json:"status-detail,omitempty" bson:"-"`
}

type MockPlanService

type MockPlanService struct {
	OnCreate      func(Plan) error
	OnList        func() ([]Plan, error)
	OnFindByName  func(string) (*Plan, error)
	OnDefaultPlan func() (*Plan, error)
	OnRemove      func(string) error
}

MockPlanService implements PlanService interface

func (*MockPlanService) Create

func (m *MockPlanService) Create(plan Plan) error

func (*MockPlanService) DefaultPlan

func (m *MockPlanService) DefaultPlan() (*Plan, error)

func (*MockPlanService) FindByName

func (m *MockPlanService) FindByName(name string) (*Plan, error)

func (*MockPlanService) List

func (m *MockPlanService) List() ([]Plan, error)

func (*MockPlanService) Remove

func (m *MockPlanService) Remove(name string) error

type MockPlanStorage

type MockPlanStorage struct {
	OnInsert      func(Plan) error
	OnFindAll     func() ([]Plan, error)
	OnFindDefault func() (*Plan, error)
	OnFindByName  func(string) (*Plan, error)
	OnDelete      func(Plan) error
}

MockPlanStorage implements PlanStorage interface

func (*MockPlanStorage) Delete

func (m *MockPlanStorage) Delete(p Plan) error

func (*MockPlanStorage) FindAll

func (m *MockPlanStorage) FindAll() ([]Plan, error)

func (*MockPlanStorage) FindByName

func (m *MockPlanStorage) FindByName(name string) (*Plan, error)

func (*MockPlanStorage) FindDefault

func (m *MockPlanStorage) FindDefault() (*Plan, error)

func (*MockPlanStorage) Insert

func (m *MockPlanStorage) Insert(p Plan) error

type MockPlatformService

type MockPlatformService struct {
	OnCreate     func(PlatformOptions) error
	OnList       func(bool) ([]Platform, error)
	OnFindByName func(string) (*Platform, error)
	OnUpdate     func(PlatformOptions) error
	OnRemove     func(string) error
}

MockPlatformService implements PlatformService interface

func (*MockPlatformService) Create

func (m *MockPlatformService) Create(opts PlatformOptions) error

func (*MockPlatformService) FindByName

func (m *MockPlatformService) FindByName(name string) (*Platform, error)

func (*MockPlatformService) List

func (m *MockPlatformService) List(enabledOnly bool) ([]Platform, error)

func (*MockPlatformService) Remove

func (m *MockPlatformService) Remove(name string) error

func (*MockPlatformService) Update

func (m *MockPlatformService) Update(opts PlatformOptions) error

type MockPlatformStorage

type MockPlatformStorage struct {
	OnInsert      func(Platform) error
	OnFindByName  func(string) (*Platform, error)
	OnFindAll     func() ([]Platform, error)
	OnFindEnabled func() ([]Platform, error)
	OnUpdate      func(Platform) error
	OnDelete      func(Platform) error
}

MockPlatformStorage implements PlatformStorage interface

func (*MockPlatformStorage) Delete

func (m *MockPlatformStorage) Delete(p Platform) error

func (*MockPlatformStorage) FindAll

func (m *MockPlatformStorage) FindAll() ([]Platform, error)

func (*MockPlatformStorage) FindByName

func (m *MockPlatformStorage) FindByName(name string) (*Platform, error)

func (*MockPlatformStorage) FindEnabled

func (m *MockPlatformStorage) FindEnabled() ([]Platform, error)

func (*MockPlatformStorage) Insert

func (m *MockPlatformStorage) Insert(p Platform) error

func (*MockPlatformStorage) Update

func (m *MockPlatformStorage) Update(p Platform) error

type Plan

type Plan struct {
	Name     string `json:"name"`
	Memory   int64  `json:"memory"`
	Swap     int64  `json:"swap"`
	CpuShare int    `json:"cpushare"`
	Default  bool   `json:"default,omitempty"`
}

type PlanService

type PlanService interface {
	Create(plan Plan) error
	List() ([]Plan, error)
	FindByName(name string) (*Plan, error)
	DefaultPlan() (*Plan, error)
	Remove(planName string) error
}

type PlanStorage

type PlanStorage interface {
	Insert(Plan) error
	FindAll() ([]Plan, error)
	FindDefault() (*Plan, error)
	FindByName(string) (*Plan, error)
	Delete(Plan) error
}

type PlanValidationError

type PlanValidationError struct {
	Field string
}

func (PlanValidationError) Error

func (p PlanValidationError) Error() string

type Platform

type Platform struct {
	Name     string
	Disabled bool
}

type PlatformOptions

type PlatformOptions struct {
	Name   string
	Args   map[string]string
	Input  io.Reader
	Output io.Writer
}

type PlatformService

type PlatformService interface {
	Create(PlatformOptions) error
	List(bool) ([]Platform, error)
	FindByName(string) (*Platform, error)
	Update(PlatformOptions) error
	Remove(string) error
}

type PlatformStorage

type PlatformStorage interface {
	Insert(Platform) error
	FindByName(string) (*Platform, error)
	FindAll() ([]Platform, error)
	FindEnabled() ([]Platform, error)
	Update(Platform) error
	Delete(Platform) error
}

Jump to

Keyboard shortcuts

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