Documentation
¶
Index ¶
- func OperationResponse(op *operations.Operation, version string) api.Response
- type API
- type AcceptAPI
- type Cluster
- type ClusterAcceptRequest
- type ClusterAcceptResponse
- type ClusterJoin
- type ClusterPromoteRequest
- type ClusterRaftNode
- type ClusterRenameRequest
- type MemberNodesAPI
- type MembersAPI
- type Option
- type PromoteAPI
- type RaftNode
- type RebalanceAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OperationResponse ¶
func OperationResponse(op *operations.Operation, version string) api.Response
OperationResponse creates an API Response from an operation.
Types ¶
type API ¶
type API struct { api.DefaultService // contains filtered or unexported fields }
API defines a query API
func (*API) Get ¶
Get defines a service for calling "GET" method and returns a response. Return information about the cluster.
func (*API) Put ¶
Put defines a service for calling "PUT" method and returns a response. Depending on the parameters passed and on local state this endpoint will either:
- bootstrap a new cluster (if this node is not clustered yet) - request to join an existing cluster - disable clustering on a node
type AcceptAPI ¶
type AcceptAPI struct { api.DefaultService // contains filtered or unexported fields }
AcceptAPI defines a query AcceptAPI
func NewAcceptAPI ¶
NewAcceptAPI creates a AcceptAPI with sane defaults
type Cluster ¶
type Cluster struct { ServerName string `json:"server_name" yaml:"server_name"` Enabled bool `json:"enabled" yaml:"enabled"` }
Cluster represents high-level information about the cluster.
type ClusterAcceptRequest ¶
type ClusterAcceptRequest struct { Name string `json:"name" yaml:"name"` Address string `json:"address" yaml:"address"` Schema int `json:"schema" yaml:"schema"` API int `json:"api" yaml:"api"` }
ClusterAcceptRequest is a request for the /internal/cluster/accept endpoint.
type ClusterAcceptResponse ¶
type ClusterAcceptResponse struct { RaftNodes []RaftNode `json:"raft_nodes" yaml:"raft_nodes"` PrivateKey []byte `json:"private_key" yaml:"private_key"` }
ClusterAcceptResponse is a Response for the /internal/cluster/accept endpoint.
type ClusterJoin ¶
type ClusterJoin struct { Cluster `yaml:",inline"` ClusterAddress string `json:"cluster_address" yaml:"cluster_address"` ClusterCertificate string `json:"cluster_certificate" yaml:"cluster_certificate"` ClusterKey string `json:"cluster_key" yaml:"cluster_key"` ServerAddress string `json:"server_address" yaml:"server_address"` }
ClusterJoin represents the fields required to bootstrap or join a cluster.
type ClusterPromoteRequest ¶
type ClusterPromoteRequest struct {
RaftNodes []RaftNode `json:"raft_nodes" yaml:"raft_nodes"`
}
ClusterPromoteRequest is a Response for the /internal/cluster/promote endpoint.
type ClusterRaftNode ¶
type ClusterRaftNode struct { ServerName string `json:"server_name" yaml:"server_name"` URL string `json:"url" yaml:"url"` Database bool `json:"database" yaml:"database"` Status string `json:"status" yaml:"status"` Message string `json:"message" yaml:"message"` }
ClusterRaftNode represents a node part of the raft cluster
type ClusterRenameRequest ¶
type ClusterRenameRequest struct {
ServerName string `json:"server_name" yaml:"server_name"`
}
ClusterRenameRequest is a request for the /cluster/members/{name} endpoint.
type MemberNodesAPI ¶
type MemberNodesAPI struct { api.DefaultService // contains filtered or unexported fields }
MemberNodesAPI defines a query MemberNodesAPI
func NewMemberNodesAPI ¶
func NewMemberNodesAPI(name string, options ...Option) *MemberNodesAPI
NewMemberNodesAPI creates a MemberNodesAPI with sane defaults
func (*MemberNodesAPI) Delete ¶
Delete defines a service for calling "DELETE" method and returns a response.
func (*MemberNodesAPI) Get ¶
Get defines a service for calling "POST" method and returns a response. Return information about the cluster.
func (*MemberNodesAPI) Name ¶
func (a *MemberNodesAPI) Name() string
Name returns the MemberNodesAPI name
type MembersAPI ¶
type MembersAPI struct { api.DefaultService // contains filtered or unexported fields }
MembersAPI defines a query MembersAPI
func NewMembersAPI ¶
func NewMembersAPI(name string, options ...Option) *MembersAPI
NewMembersAPI creates a MembersAPI with sane defaults
type Option ¶
type Option func(*options)
Option to be passed to Connect to customize the resulting instance.
func WithFileSystem ¶
func WithFileSystem(fileSystem fsys.FileSystem) Option
WithFileSystem sets the fileSystem on the option
func WithLogger ¶
WithLogger sets the logger on the option
type PromoteAPI ¶
type PromoteAPI struct { api.DefaultService // contains filtered or unexported fields }
PromoteAPI defines a query PromoteAPI
func NewPromoteAPI ¶
func NewPromoteAPI(name string, options ...Option) *PromoteAPI
NewPromoteAPI creates a PromoteAPI with sane defaults
type RaftNode ¶
type RaftNode struct { ID int64 `json:"id" yaml:"id"` Address string `json:"address" yaml:"address"` }
RaftNode a node that is part of the raft cluster.
type RebalanceAPI ¶
type RebalanceAPI struct { api.DefaultService // contains filtered or unexported fields }
RebalanceAPI defines a query RebalanceAPI
func NewRebalanceAPI ¶
func NewRebalanceAPI(name string, options ...Option) *RebalanceAPI
NewRebalanceAPI creates a RebalanceAPI with sane defaults