meta

package
v0.0.0-...-d592252 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	OBPROXY_HOME_PATH = ""
	OBPROXY_SQL_PORT  = 0
)
View Source
var (
	MYSQL_PORT = 0
	RPC_PORT   = 0
)
View Source
var (
	OCEANBASE_PWD                  string
	OBPROXY_SYS_PWD                string
	AGENT_PWD                      AgentPwd
	OCEANBASE_PASSWORD_INITIALIZED bool // Which means the oceanbase password has been initialized
)

Functions

func ClearOceanbasePwd

func ClearOceanbasePwd()

func GetObproxySysPwd

func GetObproxySysPwd() string

func GetOceanbasePwd

func GetOceanbasePwd() string

func IsObproxyAgent

func IsObproxyAgent() bool

func SetObproxySysPwd

func SetObproxySysPwd(pwd string)

func SetOceanbasePwd

func SetOceanbasePwd(pwd string)

Types

type Agent

type Agent interface {
	AgentInfoWithZoneInterface
	GetIdentity() AgentIdentity
	IsMasterAgent() bool
	IsSingleAgent() bool
	IsFollowerAgent() bool
	IsClusterAgent() bool
	IsTakeover() bool
	IsTakeOverFollowerAgent() bool
	IsTakeOverMasterAgent() bool
	IsScalingOutAgent() bool
	IsScalingInAgent() bool
	IsUnidentified() bool
	GetVersion() string
	GetAgentInfo() AgentInfo
	String() string
	IsIPv6() bool
	GetLocalIp() string
	Equal(other AgentInfoInterface) bool
}
var OCS_AGENT Agent

type AgentIdentity

type AgentIdentity string
const (
	MASTER             AgentIdentity = "MASTER"
	FOLLOWER           AgentIdentity = "FOLLOWER"
	SINGLE             AgentIdentity = "SINGLE"
	CLUSTER_AGENT      AgentIdentity = "CLUSTER AGENT"
	TAKE_OVER_MASTER   AgentIdentity = "TAKE OVER MASTER"
	TAKE_OVER_FOLLOWER AgentIdentity = "TAKE OVER FOLLOWER"
	SCALING_OUT        AgentIdentity = "SCALING OUT"
	SCALING_IN         AgentIdentity = "SCALING IN"
	UNIDENTIFIED       AgentIdentity = "UNIDENTIFIED"

	AUTH_V1 = "v1"
	AUTH_V2 = "v2"
)

type AgentInfo

type AgentInfo struct {
	Ip   string `json:"ip" form:"ip" binding:"required"`
	Port int    `json:"port" form:"port" binding:"required"`
}

func ConvertAddressToAgentInfo

func ConvertAddressToAgentInfo(host string) (*AgentInfo, error)

func NewAgentInfo

func NewAgentInfo(ip string, port int) *AgentInfo

func NewAgentInfoByInterface

func NewAgentInfoByInterface(agentInfo AgentInfoInterface) *AgentInfo

func NewAgentInfoByString

func NewAgentInfoByString(info string) *AgentInfo

func (*AgentInfo) Equal

func (a *AgentInfo) Equal(agent AgentInfoInterface) bool

func (*AgentInfo) GetIp

func (agentInfo *AgentInfo) GetIp() string

func (*AgentInfo) GetLocalIp

func (agentInfo *AgentInfo) GetLocalIp() string

func (*AgentInfo) GetPort

func (agentInfo *AgentInfo) GetPort() int

func (*AgentInfo) IsIPv6

func (agentInfo *AgentInfo) IsIPv6() bool

func (AgentInfo) String

func (agentInfo AgentInfo) String() string

type AgentInfoInterface

type AgentInfoInterface interface {
	GetIp() string
	GetPort() int
	String() string
}

type AgentInfoWithIdentity

type AgentInfoWithIdentity struct {
	AgentInfo
	IdentityDTO
}

func NewAgentInfoWithIdentity

func NewAgentInfoWithIdentity(ip string, port int, identity AgentIdentity) *AgentInfoWithIdentity

type AgentInfoWithZone

type AgentInfoWithZone struct {
	AgentInfo
	ZoneDTO
}

func NewAgentWithZone

func NewAgentWithZone(ip string, port int, zone string) *AgentInfoWithZone

func NewAgentWithZoneByAgentInfo

func NewAgentWithZoneByAgentInfo(agentInfo AgentInfoInterface, zone string) *AgentInfoWithZone

type AgentInfoWithZoneInterface

type AgentInfoWithZoneInterface interface {
	AgentInfoInterface
	GetZone() string
}

type AgentInstance

type AgentInstance struct {
	AgentInfo
	ZoneDTO
	IdentityDTO
	Version string `json:"version"`
}

func NewAgentInstance

func NewAgentInstance(ip string, port int, zone string, identity AgentIdentity, version string) *AgentInstance

func NewAgentInstanceByAgent

func NewAgentInstanceByAgent(agent Agent) *AgentInstance

func NewAgentInstanceByAgentInfo

func NewAgentInstanceByAgentInfo(agentInfo AgentInfoInterface, zone string, identity AgentIdentity, version string) *AgentInstance

func (*AgentInstance) GetAgentInfo

func (agent *AgentInstance) GetAgentInfo() AgentInfo

func (*AgentInstance) GetVersion

func (agent *AgentInstance) GetVersion() string

type AgentPwd

type AgentPwd struct {
	// contains filtered or unexported fields
}

func (*AgentPwd) GetPassword

func (p *AgentPwd) GetPassword() string

func (*AgentPwd) Inited

func (p *AgentPwd) Inited() bool

func (*AgentPwd) SetPassword

func (p *AgentPwd) SetPassword(pwd string)

type AgentSecret

type AgentSecret struct {
	AgentInfo
	PublicKeyDTO
}

func NewAgentSecret

func NewAgentSecret(ip string, port int, publicKey string) *AgentSecret

func NewAgentSecretByAgentInfo

func NewAgentSecretByAgentInfo(agent AgentInfoInterface, publicKey string) *AgentSecret

type AgentStatus

type AgentStatus struct {
	Pid          int    `json:"pid"`
	State        int32  `json:"state"`
	StartAt      int64  `json:"startAt"`
	HomePath     string `json:"homePath"`
	OBVersion    string `json:"obVersion"`
	Architecture string `json:"architecture"`
	AgentInstance
	IsObproxyAgent bool     `json:"isObproxyAgent"`
	Security       bool     `json:"security"`
	SupportedAuth  []string `json:"supportedAuth"`
}

func NewAgentStatus

func NewAgentStatus(agent Agent, pid int, state int32, startAt int64, homePath string, obVersion string, isAgentPasswordSet bool, isObproxyAgent bool) *AgentStatus

type IdentityDTO

type IdentityDTO struct {
	Identity AgentIdentity `json:"identity" binding:"required"`
}

func (*IdentityDTO) GetIdentity

func (agent *IdentityDTO) GetIdentity() AgentIdentity

func (*IdentityDTO) IsClusterAgent

func (agent *IdentityDTO) IsClusterAgent() bool

func (*IdentityDTO) IsFollowerAgent

func (agent *IdentityDTO) IsFollowerAgent() bool

func (*IdentityDTO) IsMasterAgent

func (agent *IdentityDTO) IsMasterAgent() bool

func (*IdentityDTO) IsScalingInAgent

func (agent *IdentityDTO) IsScalingInAgent() bool

func (*IdentityDTO) IsScalingOutAgent

func (agent *IdentityDTO) IsScalingOutAgent() bool

func (*IdentityDTO) IsSingleAgent

func (agent *IdentityDTO) IsSingleAgent() bool

func (*IdentityDTO) IsTakeOverFollowerAgent

func (agent *IdentityDTO) IsTakeOverFollowerAgent() bool

func (*IdentityDTO) IsTakeOverMasterAgent

func (agent *IdentityDTO) IsTakeOverMasterAgent() bool

func (*IdentityDTO) IsTakeover

func (agent *IdentityDTO) IsTakeover() bool

func (*IdentityDTO) IsUnidentified

func (agent *IdentityDTO) IsUnidentified() bool

type ObproxyInfo

type ObproxyInfo = AgentInfo

type ObserverSvrInfo

type ObserverSvrInfo = AgentInfo

type PublicKeyDTO

type PublicKeyDTO struct {
	PublicKey string `json:"public_key" form:"public_key" binding:"required"`
}

type ZoneDTO

type ZoneDTO struct {
	Zone string `json:"zone" binding:"required"`
}

func (*ZoneDTO) GetZone

func (agent *ZoneDTO) GetZone() string

Jump to

Keyboard shortcuts

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