Documentation
¶
Index ¶
- Constants
- Variables
- type Action
- type ActionInterface
- type CapacityService
- type CloudAccounts
- type Collection
- func (c *Collection) Create(m model.Model) error
- func (c *Collection) Delete(id *int64, m model.Model) error
- func (c *Collection) Get(id *int64, m model.Model) error
- func (c *Collection) GetWithIncludes(id *int64, m model.Model, includes []string) error
- func (c *Collection) Update(id *int64, oldM model.Model, m model.Model) error
- type Core
- func (c *Core) APIURL() string
- func (c *Core) BaseURL() string
- func (c *Core) HTTPSURL() string
- func (c *Core) HTTPURL() string
- func (c *Core) Initialize()
- func (c *Core) InitializeBackground()
- func (c *Core) InitializeForeground() error
- func (c *Core) SSLEnabled() bool
- func (c *Core) SetResourceActionStatus(m model.Model)
- func (c *Core) UIURL() string
- type DB
- func (db *DB) Count(value interface{}) error
- func (db *DB) Create(m model.Model) error
- func (db *DB) Delete(m model.Model) error
- func (db *DB) Find(out interface{}, where ...interface{}) error
- func (db *DB) First(out interface{}, where ...interface{}) error
- func (db *DB) Limit(limit interface{}) DBInterface
- func (db *DB) Model(value interface{}) DBInterface
- func (db *DB) Offset(offset interface{}) DBInterface
- func (db *DB) Preload(column string, conditions ...interface{}) DBInterface
- func (db *DB) Save(m model.Model) error
- func (db *DB) Update(attrs ...interface{}) error
- func (db *DB) Where(query interface{}, args ...interface{}) DBInterface
- type DBInterface
- type DefaultProvisioner
- type EntrypointListeners
- type EntrypointListenersInterface
- type Entrypoints
- type ErrorMissingRequiredParent
- type ErrorValidationFailed
- type KubeResourceObserver
- type KubeResources
- func (c *KubeResources) Create(m *model.KubeResource) error
- func (c *KubeResources) Delete(id *int64, m *model.KubeResource) ActionInterface
- func (c *KubeResources) Refresh(m *model.KubeResource) (err error)
- func (c *KubeResources) Start(id *int64, m *model.KubeResource) ActionInterface
- func (c *KubeResources) Stop(id *int64, m *model.KubeResource) ActionInterface
- func (c *KubeResources) Update(id *int64, oldM *model.KubeResource, m *model.KubeResource) error
- type KubeResourcesInterface
- type KubeScaler
- type Kubes
- type NodeObserver
- type NodeSize
- type Nodes
- type NodesInterface
- type PodProvisioner
- type Procedure
- type Provider
- type Provisioner
- type RecurringService
- type RepeatedActionError
- type SafeMap
- type Service
- type ServiceProvisioner
- type SessionExpirer
- type Sessions
- type SessionsInterface
- type Settings
- type Step
- type Users
- type Volumes
- func (c *Volumes) Create(m *model.Volume) error
- func (c *Volumes) Delete(id *int64, m *model.Volume) ActionInterface
- func (c *Volumes) Resize(id *int64, m *model.Volume) ActionInterface
- func (c *Volumes) Update(id *int64, oldM *model.Volume, m *model.Volume) error
- func (c *Volumes) WaitForAvailable(id *int64, m *model.Volume) error
- type VolumesInterface
Constants ¶
View Source
const (
SessionCookieName = "supergiant_session"
)
Variables ¶
View Source
var (
ErrorBadLogin = errors.New("Invalid credentials")
)
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Status *model.ActionStatus
Core *Core
Scope DBInterface
Model model.Model
ID *int64
ResourceID string
Fn func(*Action) error
CancelExisting bool
}
func (*Action) CancellableWaitFor ¶ added in v0.9.0
func (*Action) GetStatus ¶ added in v0.11.0
func (a *Action) GetStatus() *model.ActionStatus
type ActionInterface ¶ added in v0.11.0
type CapacityService ¶
func (*CapacityService) Perform ¶
func (s *CapacityService) Perform() error
type CloudAccounts ¶
type CloudAccounts struct {
Collection
}
func (*CloudAccounts) Create ¶
func (c *CloudAccounts) Create(m *model.CloudAccount) error
func (*CloudAccounts) Delete ¶
func (c *CloudAccounts) Delete(id *int64, m *model.CloudAccount) error
type Core ¶
type Core struct {
// Version is set by cmd/server/server.go
Version string
Settings
// NOTE we set these 2 in cmd/server.go to prevent having to load all the
// cloud provider various lib code everytime we load core
AWSProvider func(map[string]string) Provider
DOProvider func(map[string]string) Provider
K8S func(*model.Kube) kubernetes.ClientInterface
DefaultProvisioner Provisioner
PodProvisioner Provisioner
ServiceProvisioner Provisioner
APIClient func(authType string, authToken string) *client.Client
Log *logrus.Logger
DB DBInterface
Sessions SessionsInterface
Users *Users
CloudAccounts *CloudAccounts
Kubes *Kubes
KubeResources KubeResourcesInterface
Volumes VolumesInterface
Entrypoints *Entrypoints
EntrypointListeners EntrypointListenersInterface
Nodes NodesInterface
// TODO should this be a pseudo-collection like Sessions?
Actions *SafeMap
}
func (*Core) Initialize ¶
func (c *Core) Initialize()
NOTE this used to be core.New(), but due to how we load in values from the cli package, I needed to first actually initialize a Core struct and then configure.
func (*Core) InitializeBackground ¶ added in v0.9.0
func (c *Core) InitializeBackground()
InitializeBackground starts Action processing and RecurringServices for *Core.
func (*Core) InitializeForeground ¶ added in v0.9.0
InitializeForeground sets up Log and DB on *Core.
func (*Core) SSLEnabled ¶ added in v0.8.6
func (*Core) SetResourceActionStatus ¶
type DB ¶
func (*DB) Limit ¶ added in v0.10.1
func (db *DB) Limit(limit interface{}) DBInterface
func (*DB) Model ¶ added in v0.11.0
func (db *DB) Model(value interface{}) DBInterface
func (*DB) Offset ¶ added in v0.10.1
func (db *DB) Offset(offset interface{}) DBInterface
func (*DB) Preload ¶
func (db *DB) Preload(column string, conditions ...interface{}) DBInterface
func (*DB) Where ¶
func (db *DB) Where(query interface{}, args ...interface{}) DBInterface
type DBInterface ¶ added in v0.11.0
type DBInterface interface {
Create(model.Model) error
Save(model.Model) error
Find(out interface{}, where ...interface{}) error
First(out interface{}, where ...interface{}) error
Delete(m model.Model) error
Preload(column string, conditions ...interface{}) DBInterface
Where(query interface{}, args ...interface{}) DBInterface
Limit(limit interface{}) DBInterface
Offset(offset interface{}) DBInterface
Model(value interface{}) DBInterface
Update(attrs ...interface{}) error
Count(interface{}) error
}
type DefaultProvisioner ¶ added in v0.11.0
type DefaultProvisioner struct {
Core *Core
}
func (*DefaultProvisioner) IsRunning ¶ added in v0.11.0
func (p *DefaultProvisioner) IsRunning(kubeResource *model.KubeResource) (bool, error)
func (*DefaultProvisioner) Provision ¶ added in v0.11.0
func (p *DefaultProvisioner) Provision(kubeResource *model.KubeResource) error
func (*DefaultProvisioner) Teardown ¶ added in v0.11.0
func (p *DefaultProvisioner) Teardown(kubeResource *model.KubeResource) error
type EntrypointListeners ¶ added in v0.11.0
type EntrypointListeners struct {
Collection
}
func (*EntrypointListeners) Create ¶ added in v0.11.0
func (c *EntrypointListeners) Create(m *model.EntrypointListener) error
func (*EntrypointListeners) Delete ¶ added in v0.11.0
func (c *EntrypointListeners) Delete(id *int64, m *model.EntrypointListener) ActionInterface
type EntrypointListenersInterface ¶ added in v0.11.0
type Entrypoints ¶
type Entrypoints struct {
Collection
}
func (*Entrypoints) Create ¶
func (c *Entrypoints) Create(m *model.Entrypoint) error
func (*Entrypoints) Delete ¶
func (c *Entrypoints) Delete(id *int64, m *model.Entrypoint) ActionInterface
type ErrorMissingRequiredParent ¶ added in v0.11.0
type ErrorMissingRequiredParent struct {
// contains filtered or unexported fields
}
func (*ErrorMissingRequiredParent) Error ¶ added in v0.11.0
func (err *ErrorMissingRequiredParent) Error() string
type ErrorValidationFailed ¶ added in v0.11.0
type ErrorValidationFailed struct {
// contains filtered or unexported fields
}
func (*ErrorValidationFailed) Error ¶ added in v0.11.0
func (err *ErrorValidationFailed) Error() string
type KubeResourceObserver ¶ added in v0.11.0
type KubeResourceObserver struct {
// contains filtered or unexported fields
}
func (*KubeResourceObserver) Perform ¶ added in v0.11.0
func (s *KubeResourceObserver) Perform() (err error)
type KubeResources ¶ added in v0.11.0
type KubeResources struct {
Collection
}
func (*KubeResources) Create ¶ added in v0.11.0
func (c *KubeResources) Create(m *model.KubeResource) error
func (*KubeResources) Delete ¶ added in v0.11.0
func (c *KubeResources) Delete(id *int64, m *model.KubeResource) ActionInterface
func (*KubeResources) Refresh ¶ added in v0.11.0
func (c *KubeResources) Refresh(m *model.KubeResource) (err error)
func (*KubeResources) Start ¶ added in v0.11.0
func (c *KubeResources) Start(id *int64, m *model.KubeResource) ActionInterface
func (*KubeResources) Stop ¶ added in v0.11.0
func (c *KubeResources) Stop(id *int64, m *model.KubeResource) ActionInterface
func (*KubeResources) Update ¶ added in v0.11.0
func (c *KubeResources) Update(id *int64, oldM *model.KubeResource, m *model.KubeResource) error
TODO
type KubeResourcesInterface ¶ added in v0.11.0
type KubeResourcesInterface interface {
Create(*model.KubeResource) error
Get(*int64, model.Model) error
GetWithIncludes(*int64, model.Model, []string) error
Update(*int64, *model.KubeResource, *model.KubeResource) error
Delete(*int64, *model.KubeResource) ActionInterface
Start(*int64, *model.KubeResource) ActionInterface
Stop(*int64, *model.KubeResource) ActionInterface
Refresh(*model.KubeResource) error
}
type KubeScaler ¶
type KubeScaler struct {
// contains filtered or unexported fields
}
func (*KubeScaler) Scale ¶
func (s *KubeScaler) Scale() error
type Kubes ¶
type Kubes struct {
Collection
}
type NodeObserver ¶
type NodeObserver struct {
// contains filtered or unexported fields
}
func (*NodeObserver) Perform ¶
func (s *NodeObserver) Perform() error
type Nodes ¶
type Nodes struct {
Collection
}
type NodesInterface ¶ added in v0.11.2
type PodProvisioner ¶ added in v0.11.0
type PodProvisioner struct {
Core *Core
}
func (*PodProvisioner) IsRunning ¶ added in v0.11.0
func (p *PodProvisioner) IsRunning(kubeResource *model.KubeResource) (bool, error)
func (*PodProvisioner) Provision ¶ added in v0.11.0
func (p *PodProvisioner) Provision(kubeResource *model.KubeResource) error
func (*PodProvisioner) Teardown ¶ added in v0.11.0
func (p *PodProvisioner) Teardown(kubeResource *model.KubeResource) error
type Procedure ¶ added in v0.10.0
type Procedure struct {
Core *Core
Name string
Model model.Model
// contains filtered or unexported fields
}
type Provider ¶ added in v0.8.5
type Provider interface {
ValidateAccount(*model.CloudAccount) error
CreateKube(*model.Kube, *Action) error
DeleteKube(*model.Kube) error
CreateNode(*model.Node, *Action) error
DeleteNode(*model.Node) error
CreateVolume(*model.Volume, *Action) error
KubernetesVolumeDefinition(*model.Volume) *kubernetes.Volume
WaitForVolumeAvailable(*model.Volume, *Action) error
ResizeVolume(*model.Volume, *Action) error
DeleteVolume(*model.Volume) error
CreateEntrypoint(*model.Entrypoint, *Action) error
DeleteEntrypoint(*model.Entrypoint) error
CreateEntrypointListener(*model.EntrypointListener) error
DeleteEntrypointListener(*model.EntrypointListener) error
}
type Provisioner ¶ added in v0.11.0
type Provisioner interface {
Provision(*model.KubeResource) error
IsRunning(*model.KubeResource) (bool, error)
Teardown(*model.KubeResource) error
}
type RecurringService ¶
type RecurringService struct {
// contains filtered or unexported fields
}
func (*RecurringService) Run ¶
func (s *RecurringService) Run()
type RepeatedActionError ¶
type RepeatedActionError struct {
ResourceID string
}
func (*RepeatedActionError) Error ¶
func (err *RepeatedActionError) Error() string
type SafeMap ¶ added in v0.9.0
type SafeMap struct {
// contains filtered or unexported fields
}
SafeMap is a concurrently-accessible map
func NewSafeMap ¶ added in v0.9.0
type ServiceProvisioner ¶ added in v0.11.0
type ServiceProvisioner struct {
Core *Core
}
func (*ServiceProvisioner) IsRunning ¶ added in v0.11.0
func (p *ServiceProvisioner) IsRunning(kubeResource *model.KubeResource) (bool, error)
func (*ServiceProvisioner) Provision ¶ added in v0.11.0
func (p *ServiceProvisioner) Provision(kubeResource *model.KubeResource) error
func (*ServiceProvisioner) Teardown ¶ added in v0.11.0
func (p *ServiceProvisioner) Teardown(kubeResource *model.KubeResource) error
type SessionExpirer ¶ added in v0.9.0
type SessionExpirer struct {
// contains filtered or unexported fields
}
func (*SessionExpirer) Perform ¶ added in v0.9.0
func (s *SessionExpirer) Perform() error
type Sessions ¶ added in v0.9.0
type Sessions struct {
// contains filtered or unexported fields
}
func NewSessions ¶ added in v0.9.0
type SessionsInterface ¶ added in v0.11.2
type Settings ¶ added in v0.8.2
type Settings struct {
ConfigFilePath string
PsqlHost string `json:"psql_host"`
PsqlDb string `json:"psql_db"`
PsqlUser string `json:"psql_user"`
PsqlPass string `json:"psql_pass"`
SQLiteFile string `json:"sqlite_file"`
PublishHost string `json:"publish_host"`
HTTPPort string `json:"http_port"`
HTTPSPort string `json:"https_port"`
SSLCertFile string `json:"ssl_cert_file"`
SSLKeyFile string `json:"ssl_key_file"`
LogPath string `json:"log_file"`
LogLevel string `json:"log_level"`
UIEnabled bool `json:"ui_enabled"`
CapacityServiceEnabled bool `json:"capacity_service_enabled"`
// NOTE these MUST be provided in ascending order by cost in order to
// correctly provision the smallest size on Kube creation
//
// NodeSizes is a map of provider name (ex. "aws") and node sizes
NodeSizes map[string][]*NodeSize `json:"node_sizes"`
// NOTE this is only exposed for the purpose of testing
KubeResourceStartTimeout time.Duration
}
type Users ¶ added in v0.9.0
type Users struct {
Collection
}
type Volumes ¶
type Volumes struct {
Collection
}
func (*Volumes) Resize ¶
func (c *Volumes) Resize(id *int64, m *model.Volume) ActionInterface
Resize the Volume
type VolumesInterface ¶ added in v0.11.0
type VolumesInterface interface {
Create(*model.Volume) error
Get(*int64, model.Model) error
GetWithIncludes(*int64, model.Model, []string) error
Update(*int64, *model.Volume, *model.Volume) error
Delete(*int64, *model.Volume) ActionInterface
Resize(*int64, *model.Volume) ActionInterface
WaitForAvailable(*int64, *model.Volume) error
}
Source Files
¶
- action.go
- capacity_service.go
- cloud_accounts.go
- collection.go
- core.go
- db.go
- entrypoint_listeners.go
- entrypoints.go
- kube_resource_observer.go
- kube_resources.go
- kubes.go
- node_observer.go
- nodes.go
- procedure.go
- provider.go
- provisioner.go
- provisioner_default.go
- provisioner_pod.go
- provisioner_service.go
- recurring_service.go
- safe_map.go
- sessions.go
- users.go
- volumes.go
Click to show internal directories.
Click to hide internal directories.