Documentation ¶
Index ¶
- Constants
- func NewHTTPHandler(node *Node) http.Handler
- type InviteRequest
- type InviteResponse
- type Node
- func (n *Node) ApproveSpec(revision int) error
- func (n *Node) ClusterID() string
- func (n *Node) GetStatus() (*StatusResponse, error)
- func (n *Node) GetSyncStatus(revision int) (*SyncStatusResponse, error)
- func (n *Node) ID() string
- func (n *Node) Invite(clusterID string, initSpec *spec.Spec) error
- func (n *Node) ProposeSpec(s spec.Spec) error
- func (n *Node) RequestSync(revision int) error
- func (n *Node) Shutdown()
- func (n *Node) Start()
- type PutBlobResponse
- type RPC
- func (rpc *RPC) ApproveSpec(revision int) error
- func (rpc *RPC) GetBlob(blobKey blob.Key) (*blobio.OptBlob, error)
- func (rpc *RPC) GetBlobSlice(prefix string) (io.ReadCloser, error)
- func (rpc *RPC) GetStatus() (*StatusResponse, error)
- func (rpc *RPC) GetSyncStatus(revision int) (*SyncStatusResponse, error)
- func (rpc *RPC) Invite(initSpec *spec.Spec) (nodeID string, err error)
- func (rpc *RPC) ProposeSpec(s spec.Spec) error
- func (rpc *RPC) PutBlob(blob *blob.Blob) error
- func (rpc *RPC) SyncToSpec(revision int) error
- func (rpc *RPC) WithAddr(addr string) *RPC
- func (rpc *RPC) WithContext(ctx context.Context) *RPC
- func (rpc *RPC) WithIdentity(identity *crypto.Identity, targetID string) *RPC
- type Revisions
- type StatusResponse
- type SyncStatusResponse
Constants ¶
const (
// HTTPPathPrefix path prefix
HTTPPathPrefix = "/node/"
)
Variables ¶
This section is empty.
Functions ¶
func NewHTTPHandler ¶
NewHTTPHandler create http handler to expose operations to local node
Types ¶
type InviteRequest ¶
InviteRequest request body struct for invitation
type InviteResponse ¶
type InviteResponse struct {
NodeID string `json:"nodeID"`
}
InviteResponse response body struct for invitation
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node defines local node of solidb.
func (*Node) ApproveSpec ¶
ApproveSpec approve spec by revision. The spec to be approved should be synced.
func (*Node) GetStatus ¶
func (n *Node) GetStatus() (*StatusResponse, error)
GetStatus returns node status.
func (*Node) GetSyncStatus ¶
func (n *Node) GetSyncStatus(revision int) (*SyncStatusResponse, error)
GetSyncStatus returns progress of slice syncing
func (*Node) ProposeSpec ¶
ProposeSpec propose a new spec. The revision of proposed one should be >= newest.
func (*Node) RequestSync ¶
RequestSync request to sync slices according to spec specified by revision.
type PutBlobResponse ¶
PutBlobResponse response body struct for put blob
type RPC ¶
type RPC struct {
// contains filtered or unexported fields
}
func (*RPC) ApproveSpec ¶
func (*RPC) GetBlobSlice ¶
func (rpc *RPC) GetBlobSlice(prefix string) (io.ReadCloser, error)
func (*RPC) GetStatus ¶
func (rpc *RPC) GetStatus() (*StatusResponse, error)
func (*RPC) GetSyncStatus ¶
func (rpc *RPC) GetSyncStatus(revision int) (*SyncStatusResponse, error)
func (*RPC) SyncToSpec ¶
type Revisions ¶
type Revisions struct { Newest int `json:"newest"` Synced int `json:"synced"` Approved int `json:"approved"` }
Revisions gather all types of revision
type StatusResponse ¶
type StatusResponse struct { NodeID string `json:"nodeID"` ClusterID string `json:"clusterID"` SpecRevisions Revisions `json:"specRevisions"` }
StatusResponse status of node
type SyncStatusResponse ¶
SyncStatusResponse sync status