config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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

func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)

Create Generate new cluster configuration. If no links given, default to local IP address as link0.

func (*Client) Index

func (c *Client) Index(ctx context.Context) (*IndexResponse, error)

Index Directory index.

func (*Client) Join

func (c *Client) Join(ctx context.Context, req *JoinRequest) (*JoinResponse, error)

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

func (c *Client) JoinApiVersionApiversion(ctx context.Context) (*JoinApiVersionApiversionResponse, error)

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

func (c *Client) StatusQdevice(ctx context.Context) (*StatusQdeviceResponse, error)

StatusQdevice Get QDevice status

func (*Client) Totem

func (c *Client) Totem(ctx context.Context) (*TotemResponse, error)

Totem Get corosync totem protocol settings.

type CreateRequest

type CreateRequest struct {
	Clustername string `url:"clustername",json:"clustername"` // The name of the cluster.

	// The following parameters are optional
	Linkn  *string `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 CreateResponse

type CreateResponse string

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type IndexResponse

type IndexResponse []*map[string]interface{}

type JoinApiVersionApiversionResponse

type JoinApiVersionApiversionResponse int

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     []*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 *string `url:"ring0_addr,omitempty",json:"ring0_addr,omitempty"` // Address and priority information of a single corosync link. (up to 8 links supported; link0..link7)
	} `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.
	Linkn  *string           `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 JoinResponse

type JoinResponse string

type StatusQdeviceResponse

type StatusQdeviceResponse map[string]interface{}

type TotemResponse

type TotemResponse map[string]interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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