Documentation ¶
Index ¶
- Constants
- Variables
- func GetClusterPath(clusterName, providerName string) string
- func GetDB() (*gorm.DB, error)
- func GetDataSource() string
- func GetDefaultSSHKeyPath(clusterName, providerName string) string
- func GetLogFile(name string) (logFile *os.File, err error)
- func GetLogPath() string
- func InitStorage() error
- func NewLogger(debug bool, w *os.File) *logrus.Logger
- type Broadcaster
- type ClusterState
- type Credential
- type Store
- func (d *Store) CreateCredential(cred *Credential) error
- func (d *Store) CreateTemplate(template *Template) error
- func (d *Store) DeleteCluster(name, provider string) error
- func (d *Store) DeleteCredential(id int) error
- func (d *Store) DeleteTemplate(name, provider string) error
- func (d *Store) FindCluster(name, provider string) ([]*ClusterState, error)
- func (d *Store) GetCluster(name, provider string) (*ClusterState, error)
- func (d *Store) GetClusterByID(contextName string) (*ClusterState, error)
- func (d *Store) GetCredential(id int) (*Credential, error)
- func (d *Store) GetCredentialByProvider(provider string) ([]*Credential, error)
- func (d *Store) GetTemplate(name, provider string) (*Template, error)
- func (d *Store) ListCluster() ([]*ClusterState, error)
- func (d *Store) ListCredential() ([]*Credential, error)
- func (d *Store) ListTemplates() ([]*Template, error)
- func (d *Store) Log(apiOp *apitypes.APIRequest, input chan *ClusterState)
- func (d *Store) Register()
- func (d *Store) SaveCluster(cluster *types.Cluster) error
- func (d *Store) SaveClusterState(state *ClusterState) error
- func (d *Store) UpdateCredential(cred *Credential) error
- func (d *Store) UpdateTemplate(template *Template) error
- func (d *Store) WatchCluster(apiOp *apitypes.APIRequest, schema *apitypes.APISchema, ...)
- func (d *Store) WatchTemplate(apiOp *apitypes.APIRequest, schema *apitypes.APISchema, ...)
- type Subscriber
- type Template
Constants ¶
View Source
const ( StateFile = ".state" KubeCfgFile = ".kube/config" KubeCfgTempName = "autok3s-temp" K3sManifestsDir = "/var/lib/rancher/k3s/server/manifests" MasterInstanceName = "autok3s.%s.master" WorkerInstanceName = "autok3s.%s.worker" TagClusterPrefix = "autok3s-" StatusRunning = "Running" StatusCreating = "Creating" StatusMissing = "Missing" StatusFailed = "Failed" StatusUpgrading = "Upgrading" UsageInfoTitle = "=========================== Prompt Info ===========================" UsageContext = "Use 'autok3s kubectl config use-context %s'" UsagePods = "Use 'autok3s kubectl get pods -A' get POD status`" DBFolder = ".db" DBFile = "autok3s.db" )
Variables ¶
Functions ¶
func GetClusterPath ¶ added in v0.3.0
func GetDataSource ¶ added in v0.4.0
func GetDataSource() string
func GetDefaultSSHKeyPath ¶ added in v0.3.0
func GetLogPath ¶ added in v0.4.0
func GetLogPath() string
func InitStorage ¶ added in v0.4.0
func InitStorage() error
Types ¶
type Broadcaster ¶ added in v0.4.0
type Broadcaster struct {
// contains filtered or unexported fields
}
Broadcaster sends events to multiple subscribers
func NewBroadcaster ¶ added in v0.4.0
func NewBroadcaster() *Broadcaster
func (*Broadcaster) Broadcast ¶ added in v0.4.0
func (b *Broadcaster) Broadcast(v interface{})
Broadcast events to each subscriber
func (*Broadcaster) Evict ¶ added in v0.4.0
func (b *Broadcaster) Evict(s Subscriber)
Evict specified subscriber
func (*Broadcaster) Register ¶ added in v0.4.0
func (b *Broadcaster) Register(sf subscriberFunc) Subscriber
Register helps init subscriber with specified subscribe function
type ClusterState ¶ added in v0.4.0
type ClusterState struct { types.Metadata `json:",inline" mapstructure:",squash" gorm:"embedded"` Options []byte `json:"options,omitempty" gorm:"type:bytes"` Status string `json:"status" yaml:"status"` MasterNodes []byte `json:"master-nodes,omitempty" gorm:"type:bytes"` WorkerNodes []byte `json:"worker-nodes,omitempty" gorm:"type:bytes"` types.SSH `json:",inline" mapstructure:",squash" gorm:"embedded"` }
type Credential ¶ added in v0.4.0
type Store ¶ added in v0.4.0
func (*Store) CreateCredential ¶ added in v0.4.0
func (d *Store) CreateCredential(cred *Credential) error
func (*Store) CreateTemplate ¶ added in v0.4.0
func (*Store) DeleteCluster ¶ added in v0.4.0
func (*Store) DeleteCredential ¶ added in v0.4.0
func (*Store) DeleteTemplate ¶ added in v0.4.0
func (*Store) FindCluster ¶ added in v0.4.0
func (d *Store) FindCluster(name, provider string) ([]*ClusterState, error)
func (*Store) GetCluster ¶ added in v0.4.0
func (d *Store) GetCluster(name, provider string) (*ClusterState, error)
func (*Store) GetClusterByID ¶ added in v0.4.0
func (d *Store) GetClusterByID(contextName string) (*ClusterState, error)
func (*Store) GetCredential ¶ added in v0.4.0
func (d *Store) GetCredential(id int) (*Credential, error)
func (*Store) GetCredentialByProvider ¶ added in v0.4.0
func (d *Store) GetCredentialByProvider(provider string) ([]*Credential, error)
func (*Store) GetTemplate ¶ added in v0.4.0
func (*Store) ListCluster ¶ added in v0.4.0
func (d *Store) ListCluster() ([]*ClusterState, error)
func (*Store) ListCredential ¶ added in v0.4.0
func (d *Store) ListCredential() ([]*Credential, error)
func (*Store) ListTemplates ¶ added in v0.4.0
func (*Store) Log ¶ added in v0.4.0
func (d *Store) Log(apiOp *apitypes.APIRequest, input chan *ClusterState)
func (*Store) SaveCluster ¶ added in v0.4.0
func (*Store) SaveClusterState ¶ added in v0.4.0
func (d *Store) SaveClusterState(state *ClusterState) error
func (*Store) UpdateCredential ¶ added in v0.4.0
func (d *Store) UpdateCredential(cred *Credential) error
func (*Store) UpdateTemplate ¶ added in v0.4.0
func (*Store) WatchCluster ¶ added in v0.4.0
func (*Store) WatchTemplate ¶ added in v0.4.0
type Subscriber ¶ added in v0.4.0
type Subscriber chan interface{}
Click to show internal directories.
Click to hide internal directories.