Documentation ¶
Index ¶
- Constants
- Variables
- func NewDefaultConfig() *pbtypes.FrontgateConfig
- func NewDefaultConfigString() string
- func Serve(cfg *ConfigManager, tlsPilotConfig *tls.Config)
- func ServeReverseRpcServerForPilot(cfg *pbtypes.FrontgateConfig, tlsConfig *tls.Config, ...)
- func WithFrontgateId(id string) func(opt *pbtypes.FrontgateConfig)
- func WithFrontgateNodeList(node ...*pbtypes.FrontgateEndpoint) func(opt *pbtypes.FrontgateConfig)
- func WithListenPort(port int) func(opt *pbtypes.FrontgateConfig)
- func WithPilotService(host string, port int) func(opt *pbtypes.FrontgateConfig)
- type ConfigManager
- type EtcdClient
- func (p *EtcdClient) Clear() error
- func (p *EtcdClient) Close() error
- func (p *EtcdClient) DelValues(keys ...string) error
- func (p *EtcdClient) DelValuesWithPrefix(keyPrefixs ...string) error
- func (p *EtcdClient) DeregisterCmd(in *pbtypes.SubTask_DeregisterCmd) error
- func (p *EtcdClient) DeregisterMetadata(in *pbtypes.SubTask_DeregisterMetadata) error
- func (p *EtcdClient) DeregisterMetadataMapping(in *pbtypes.SubTask_DeregisterMetadata) error
- func (p *EtcdClient) Get(key string) (val string, ok bool)
- func (p *EtcdClient) GetAllValues() (map[string]string, error)
- func (p *EtcdClient) GetStructValue(keyPrefix string, out interface{}) error
- func (p *EtcdClient) GetValues(keys ...string) (map[string]string, error)
- func (p *EtcdClient) GetValuesByPrefix(keyPrefix string) (map[string]string, error)
- func (p *EtcdClient) Ping() error
- func (p *EtcdClient) RegisterCmd(in *pbtypes.SubTask_RegisterCmd) error
- func (p *EtcdClient) RegisterMetadata(in *pbtypes.SubTask_RegisterMetadata) error
- func (p *EtcdClient) RegisterMetadataMapping(in *pbtypes.SubTask_RegisterMetadata) error
- func (p *EtcdClient) Set(key, val string) error
- func (p *EtcdClient) SetStructValue(keyPrefix string, val interface{}) error
- func (p *EtcdClient) SetValues(m map[string]string) error
- func (p *EtcdClient) SetValuesWithPrefix(prefix string, m map[string]string) error
- type EtcdClientManager
- type Options
- type Server
- func (p *Server) ClosePilotChannel(in *pbtypes.Empty, out *pbtypes.Empty) error
- func (p *Server) DeregisterCmd(in *pbtypes.SubTask_DeregisterCmd, out *pbtypes.Empty) error
- func (p *Server) DeregisterMetadata(in *pbtypes.SubTask_DeregisterMetadata, out *pbtypes.Empty) error
- func (p *Server) DeregisterMetadataMapping(in *pbtypes.SubTask_DeregisterMetadata, out *pbtypes.Empty) error
- func (p *Server) GetConfdConfig(in *pbtypes.ConfdEndpoint, out *pbtypes.ConfdConfig) error
- func (p *Server) GetDroneConfig(in *pbtypes.DroneEndpoint, out *pbtypes.DroneConfig) error
- func (p *Server) GetDroneList(in *pbtypes.Empty, out *pbtypes.DroneIdList) error
- func (p *Server) GetDroneVersion(*pbtypes.DroneEndpoint, *pbtypes.Version) error
- func (p *Server) GetEtcdValues(in *pbtypes.StringList, out *pbtypes.StringMap) error
- func (p *Server) GetEtcdValuesByPrefix(in *pbtypes.String, out *pbtypes.StringMap) error
- func (p *Server) GetFrontgateConfig(in *pbtypes.Empty, out *pbtypes.FrontgateConfig) error
- func (p *Server) GetFrontgateVersion(*pbtypes.Empty, *pbtypes.Version) error
- func (p *Server) GetPilotConfig(in *pbtypes.Empty, out *pbtypes.PilotConfig) error
- func (p *Server) GetPilotVersion(*pbtypes.Empty, *pbtypes.Version) error
- func (p *Server) HeartBeat(in *pbtypes.Empty, out *pbtypes.Empty) error
- func (p *Server) IsConfdRunning(in *pbtypes.ConfdEndpoint, out *pbtypes.Bool) error
- func (p *Server) PingDrone(in *pbtypes.DroneEndpoint, out *pbtypes.Empty) error
- func (p *Server) PingFrontgate(in *pbtypes.Empty, out *pbtypes.Empty) error
- func (p *Server) PingFrontgateNode(in *pbtypes.Empty, out *pbtypes.Empty) error
- func (p *Server) PingMetadataBackend(*pbtypes.Empty, *pbtypes.Empty) error
- func (p *Server) PingPilot(in *pbtypes.Empty, out *pbtypes.Empty) error
- func (p *Server) RegisterCmd(in *pbtypes.SubTask_RegisterCmd, out *pbtypes.Empty) error
- func (p *Server) RegisterMetadata(in *pbtypes.SubTask_RegisterMetadata, out *pbtypes.Empty) error
- func (p *Server) RegisterMetadataMapping(in *pbtypes.SubTask_RegisterMetadata, out *pbtypes.Empty) error
- func (p *Server) ReportSubTaskStatus(in *pbtypes.SubTaskStatus, out *pbtypes.Empty) error
- func (p *Server) RunCommand(arg *pbtypes.RunCommandOnFrontgateRequest, out *pbtypes.String) error
- func (p *Server) RunCommandOnDrone(in *pbtypes.RunCommandOnDroneRequest, out *pbtypes.String) error
- func (p *Server) SetDroneConfig(in *pbtypes.SetDroneConfigRequest, out *pbtypes.Empty) error
- func (p *Server) SetEtcdValues(in *pbtypes.StringMap, out *pbtypes.Empty) error
- func (p *Server) SetFrontgateConfig(cfg *pbtypes.FrontgateConfig, out *pbtypes.Empty) error
- func (p *Server) SetFrontgateNodeConfig(cfg *pbtypes.FrontgateConfig, out *pbtypes.Empty) error
- func (p *Server) StartConfd(in *pbtypes.ConfdEndpoint, out *pbtypes.Empty) error
- func (p *Server) StopConfd(in *pbtypes.ConfdEndpoint, out *pbtypes.Empty) error
- type Updater
Constants ¶
View Source
const DefaultEtcdMaxOpsPerTxn = 128
Variables ¶
View Source
var ( Version = version.ShortVersion CheckInterval = 10 * time.Second RetryInterval = 3 * time.Second RetryCount = 5 OpenPitrixReleaseUrlPattern = "https://github.com/openpitrix/openpitrix/releases/download/%s/openpitrix-%s-bin.tar.gz" HttpServePath = "/opt/openpitrix/bin" DowloadPathPattern = "/opt/openpitrix/bin/%s" DowloadFilePathPattern = "/opt/openpitrix/bin/%s/%s" PilotVersionFilePath = "/opt/openpitrix/conf/pilot-version" KeyPrefix = "/" KeyRegexp = regexp.MustCompile(`^\/\d+\.\d+\.\d+\.\d+\/host\/ip$`) EtcdEndpoints = []string{"127.0.0.1:2379"} )
Functions ¶
func NewDefaultConfig ¶
func NewDefaultConfig() *pbtypes.FrontgateConfig
func NewDefaultConfigString ¶
func NewDefaultConfigString() string
func Serve ¶
func Serve(cfg *ConfigManager, tlsPilotConfig *tls.Config)
func WithFrontgateId ¶
func WithFrontgateId(id string) func(opt *pbtypes.FrontgateConfig)
func WithFrontgateNodeList ¶
func WithFrontgateNodeList(node ...*pbtypes.FrontgateEndpoint) func(opt *pbtypes.FrontgateConfig)
func WithListenPort ¶
func WithListenPort(port int) func(opt *pbtypes.FrontgateConfig)
func WithPilotService ¶
Types ¶
type ConfigManager ¶
type ConfigManager struct {
// contains filtered or unexported fields
}
func NewConfigManager ¶
func NewConfigManager(path string, cfg *pbtypes.FrontgateConfig, opts ...Options) *ConfigManager
func (*ConfigManager) Get ¶
func (p *ConfigManager) Get() (cfg *pbtypes.FrontgateConfig)
func (*ConfigManager) Save ¶
func (p *ConfigManager) Save() error
func (*ConfigManager) Set ¶
func (p *ConfigManager) Set(cfg *pbtypes.FrontgateConfig) error
type EtcdClient ¶
func NewEtcdClient ¶
func NewEtcdClientWithConfig ¶
func NewEtcdClientWithConfig(cfg clientv3.Config, maxTxnOps int) (*EtcdClient, error)
func (*EtcdClient) Clear ¶
func (p *EtcdClient) Clear() error
func (*EtcdClient) Close ¶
func (p *EtcdClient) Close() error
func (*EtcdClient) DelValues ¶
func (p *EtcdClient) DelValues(keys ...string) error
func (*EtcdClient) DelValuesWithPrefix ¶
func (p *EtcdClient) DelValuesWithPrefix(keyPrefixs ...string) error
func (*EtcdClient) DeregisterCmd ¶
func (p *EtcdClient) DeregisterCmd(in *pbtypes.SubTask_DeregisterCmd) error
func (*EtcdClient) DeregisterMetadata ¶
func (p *EtcdClient) DeregisterMetadata(in *pbtypes.SubTask_DeregisterMetadata) error
func (*EtcdClient) DeregisterMetadataMapping ¶ added in v0.2.3
func (p *EtcdClient) DeregisterMetadataMapping(in *pbtypes.SubTask_DeregisterMetadata) error
func (*EtcdClient) GetAllValues ¶
func (p *EtcdClient) GetAllValues() (map[string]string, error)
func (*EtcdClient) GetStructValue ¶
func (p *EtcdClient) GetStructValue(keyPrefix string, out interface{}) error
func (*EtcdClient) GetValues ¶
func (p *EtcdClient) GetValues(keys ...string) (map[string]string, error)
func (*EtcdClient) GetValuesByPrefix ¶
func (p *EtcdClient) GetValuesByPrefix(keyPrefix string) (map[string]string, error)
func (*EtcdClient) Ping ¶ added in v0.2.1
func (p *EtcdClient) Ping() error
func (*EtcdClient) RegisterCmd ¶
func (p *EtcdClient) RegisterCmd(in *pbtypes.SubTask_RegisterCmd) error
func (*EtcdClient) RegisterMetadata ¶
func (p *EtcdClient) RegisterMetadata(in *pbtypes.SubTask_RegisterMetadata) error
func (*EtcdClient) RegisterMetadataMapping ¶ added in v0.2.3
func (p *EtcdClient) RegisterMetadataMapping(in *pbtypes.SubTask_RegisterMetadata) error
func (*EtcdClient) Set ¶
func (p *EtcdClient) Set(key, val string) error
func (*EtcdClient) SetStructValue ¶
func (p *EtcdClient) SetStructValue(keyPrefix string, val interface{}) error
func (*EtcdClient) SetValuesWithPrefix ¶ added in v0.2.3
func (p *EtcdClient) SetValuesWithPrefix(prefix string, m map[string]string) error
type EtcdClientManager ¶
type EtcdClientManager struct {
// contains filtered or unexported fields
}
func NewEtcdClientManager ¶
func NewEtcdClientManager() *EtcdClientManager
func (*EtcdClientManager) Clear ¶
func (p *EtcdClientManager) Clear()
func (*EtcdClientManager) ClearClient ¶
func (p *EtcdClientManager) ClearClient(client *EtcdClient)
func (*EtcdClientManager) Get ¶
func (p *EtcdClientManager) Get() (*EtcdClient, error)
func (*EtcdClientManager) GetClient ¶
func (p *EtcdClientManager) GetClient(endpoints []string, timeout time.Duration, maxTxnOps int) (*EtcdClient, error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) ClosePilotChannel ¶
func (*Server) DeregisterCmd ¶
func (*Server) DeregisterMetadata ¶
func (*Server) DeregisterMetadataMapping ¶ added in v0.2.3
func (*Server) GetConfdConfig ¶
func (*Server) GetDroneConfig ¶
func (*Server) GetDroneList ¶
func (*Server) GetDroneVersion ¶ added in v0.2.1
func (*Server) GetEtcdValues ¶
func (*Server) GetEtcdValuesByPrefix ¶
func (*Server) GetFrontgateConfig ¶
func (*Server) GetFrontgateVersion ¶ added in v0.2.1
func (*Server) GetPilotConfig ¶
func (*Server) GetPilotVersion ¶ added in v0.2.1
func (*Server) IsConfdRunning ¶
func (*Server) PingFrontgate ¶
func (*Server) PingFrontgateNode ¶
func (*Server) PingMetadataBackend ¶ added in v0.2.1
func (*Server) RegisterCmd ¶
func (*Server) RegisterMetadata ¶
func (*Server) RegisterMetadataMapping ¶ added in v0.2.3
func (*Server) ReportSubTaskStatus ¶
func (*Server) RunCommand ¶
func (*Server) RunCommandOnDrone ¶
func (*Server) SetDroneConfig ¶
func (*Server) SetEtcdValues ¶
func (*Server) SetFrontgateConfig ¶
func (*Server) SetFrontgateNodeConfig ¶
func (*Server) StartConfd ¶
type Updater ¶ added in v0.2.3
type Updater struct {
// contains filtered or unexported fields
}
func NewUpdater ¶ added in v0.2.3
func NewUpdater(conn *grpc.ClientConn, connClosed <-chan struct{}, cfg *pbtypes.FrontgateConfig) *Updater
Source Files ¶
Click to show internal directories.
Click to hide internal directories.