Documentation
¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, req CreateRequest) (string, error)
- func (c *Client) Index(ctx context.Context) ([]map[string]interface{}, error)
- func (c *Client) Join(ctx context.Context, req JoinRequest) (string, error)
- func (c *Client) JoinApiVersionApiversion(ctx context.Context) (int, error)
- func (c *Client) JoinInfoJoin(ctx context.Context, req JoinInfoJoinRequest) (JoinInfoJoinResponse, error)
- func (c *Client) StatusQdevice(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) Totem(ctx context.Context) (map[string]interface{}, error)
- type CreateRequest
- type HTTPClient
- type JoinInfoJoinRequest
- type JoinInfoJoinResponse
- type JoinRequest
- type Linkn
- type LinknArr
- type Nodelist
- type Ring0Addr
- type Ring0AddrArr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(c HTTPClient) *Client
func (*Client) Create ¶
Create Generate new cluster configuration. If no links given, default to local IP address as link0.
func (*Client) Join ¶
Join Joins this node into an existing cluster. If no links are given, default to IP resolved by node's hostname on single link (fallback fails for clusters with multiple links).
func (*Client) JoinApiVersionApiversion ¶
JoinApiVersionApiversion Return the version of the cluster join API available on this node.
func (*Client) JoinInfoJoin ¶
func (c *Client) JoinInfoJoin(ctx context.Context, req JoinInfoJoinRequest) (JoinInfoJoinResponse, error)
JoinInfoJoin Get information needed to join this cluster over the connected node.
func (*Client) StatusQdevice ¶
StatusQdevice Get QDevice status
type CreateRequest ¶
type CreateRequest struct { Clustername string `url:"clustername" json:"clustername"` // The name of the cluster. // The following parameters are optional Links *LinknArr `url:"link[n],omitempty" json:"link[n],omitempty"` // Address and priority information of a single corosync link. (up to 8 links supported; link0..link7) Nodeid *int `url:"nodeid,omitempty" json:"nodeid,omitempty"` // Node id for this node. Votes *int `url:"votes,omitempty" json:"votes,omitempty"` // Number of votes for this node. }
type HTTPClient ¶
type JoinInfoJoinRequest ¶
type JoinInfoJoinRequest struct { // The following parameters are optional Node *string `url:"node,omitempty" json:"node,omitempty"` // The node for which the joinee gets the nodeinfo. }
type JoinInfoJoinResponse ¶
type JoinInfoJoinResponse struct { ConfigDigest string `url:"config_digest" json:"config_digest"` Nodelist []Nodelist `url:"nodelist" json:"nodelist"` PreferredNode string `url:"preferred_node" json:"preferred_node"` // The cluster node name. Totem map[string]interface{} `url:"totem" json:"totem"` }
type JoinRequest ¶
type JoinRequest struct { Fingerprint string `url:"fingerprint" json:"fingerprint"` // Certificate SHA 256 fingerprint. Hostname string `url:"hostname" json:"hostname"` // Hostname (or IP) of an existing cluster member. Password string `url:"password" json:"password"` // Superuser (root) password of peer node. // The following parameters are optional Force *util.SpecialBool `url:"force,omitempty" json:"force,omitempty"` // Do not throw error if node already exists. Links *LinknArr `url:"link[n],omitempty" json:"link[n],omitempty"` // Address and priority information of a single corosync link. (up to 8 links supported; link0..link7) Nodeid *int `url:"nodeid,omitempty" json:"nodeid,omitempty"` // Node id for this node. Votes *int `url:"votes,omitempty" json:"votes,omitempty"` // Number of votes for this node }
type Linkn ¶ added in v0.0.10
type Linkn struct { Address string `url:"address" json:"address"` // Hostname (or IP) of this corosync link address. // The following parameters are optional Priority *int `url:"priority,omitempty" json:"priority,omitempty"` // The priority for the link when knet is used in 'passive' mode (default). Lower value means higher priority. Only valid for cluster create, ignored on node add. }
Address and priority information of a single corosync link. (up to 8 links supported; link0..link7)
type Nodelist ¶ added in v0.0.10
type Nodelist struct { Name string `url:"name" json:"name"` // The cluster node name. PveAddr string `url:"pve_addr" json:"pve_addr"` PveFp string `url:"pve_fp" json:"pve_fp"` // Certificate SHA 256 fingerprint. QuorumVotes int `url:"quorum_votes" json:"quorum_votes"` // The following parameters are optional Nodeid *int `url:"nodeid,omitempty" json:"nodeid,omitempty"` // Node id for this node. Ring0Addr *Ring0Addr `url:"ring0_addr,omitempty" json:"ring0_addr,omitempty"` // Address and priority information of a single corosync link. (up to 8 links supported; link0..link7) }
type Ring0Addr ¶ added in v0.0.10
type Ring0Addr struct { Address string `url:"address" json:"address"` // Hostname (or IP) of this corosync link address. // The following parameters are optional Priority *int `url:"priority,omitempty" json:"priority,omitempty"` // The priority for the link when knet is used in 'passive' mode (default). Lower value means higher priority. Only valid for cluster create, ignored on node add. }
Address and priority information of a single corosync link. (up to 8 links supported; link0..link7)
type Ring0AddrArr ¶ added in v0.0.10
type Ring0AddrArr []Ring0Addr
Array of Ring0Addr
func (Ring0AddrArr) EncodeValues ¶ added in v0.0.10
func (t Ring0AddrArr) EncodeValues(key string, v *url.Values) error