Documentation ¶
Index ¶
- Variables
- type AppRouter
- type MockPlanService
- type MockPlanStorage
- type MockPlatformService
- func (m *MockPlatformService) Create(opts PlatformOptions) error
- func (m *MockPlatformService) FindByName(name string) (*Platform, error)
- func (m *MockPlatformService) List(enabledOnly bool) ([]Platform, error)
- func (m *MockPlatformService) Remove(name string) error
- func (m *MockPlatformService) Update(opts PlatformOptions) error
- type MockPlatformStorage
- func (m *MockPlatformStorage) Delete(p Platform) error
- func (m *MockPlatformStorage) FindAll() ([]Platform, error)
- func (m *MockPlatformStorage) FindByName(name string) (*Platform, error)
- func (m *MockPlatformStorage) FindEnabled() ([]Platform, error)
- func (m *MockPlatformStorage) Insert(p Platform) error
- func (m *MockPlatformStorage) Update(p Platform) error
- type Plan
- type PlanService
- type PlanStorage
- type PlanValidationError
- type Platform
- type PlatformOptions
- type PlatformService
- type PlatformStorage
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") 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 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 PlanService ¶
type PlanStorage ¶
type PlanValidationError ¶
type PlanValidationError struct {
Field string
}
func (PlanValidationError) Error ¶
func (p PlanValidationError) Error() string
type PlatformOptions ¶
type PlatformService ¶
Click to show internal directories.
Click to hide internal directories.