Documentation ¶
Index ¶
- func CredentialsFor(credStr *auth.CredentialsStore, username string) *v1.Credentials
- type Client
- func (c *Client) Aggregate(ctx context.Context, req *v1.Aggregate_Request, nodeAddr string, ...) (*v1.Aggregate_Response, error)
- func (c *Client) Backup(ctx context.Context, w io.Writer, req *v1.Backup_Request, nodeAddr string, ...) error
- func (c *Client) Breakdown(ctx context.Context, req *v1.BreakDown_Request, nodeAddr string, ...) (*v1.BreakDown_Response, error)
- func (c *Client) GetNodeAPIAddr(ctx context.Context, nodeAddr string) (string, error)
- func (c *Client) Join(ctx context.Context, req *v1.Join_Request, nodeAddr string, ...) error
- func (c *Client) Load(ctx context.Context, req *v1.Load_Request, nodeAddr string, ...) error
- func (c *Client) Notify(ctx context.Context, req *v1.Notify_Request, nodeAddr string, ...) error
- func (c *Client) Realtime(ctx context.Context, req *v1.Realtime_Request, nodeAddr string, ...) (*v1.Realtime_Response, error)
- func (c *Client) RemoveNode(ctx context.Context, req *v1.RemoveNode_Request, nodeAddr string, ...) error
- func (c *Client) SendData(ctx context.Context, req *v1.Data, nodeAddr string, creds *v1.Credentials) error
- func (c *Client) Status() *v1.Status_Cluster
- func (c *Client) Timeseries(ctx context.Context, req *v1.Timeseries_Request, nodeAddr string, ...) (*v1.Timeseries_Response, error)
- type CredentialStore
- type Interceptor
- type Klient
- type Service
- func (s *Service) Addr() string
- func (s *Service) Aggregate(ctx context.Context, req *v1.Aggregate_Request) (*v1.Aggregate_Response, error)
- func (s *Service) Backup(req *v1.Backup_Request, svr v1.InternalCLuster_BackupServer) error
- func (s *Service) BreakDown(ctx context.Context, req *v1.BreakDown_Request) (*v1.BreakDown_Response, error)
- func (s *Service) Close() error
- func (s *Service) EnableHTTPS(b bool)
- func (s *Service) GetAPIAddr() string
- func (s *Service) GetNodeAPIURL() string
- func (s *Service) Join(ctx context.Context, req *v1.Join_Request) (*v1.Join_Response, error)
- func (s *Service) Load(ctx context.Context, req *v1.Load_Request) (*emptypb.Empty, error)
- func (s *Service) NodeAPI(ctx context.Context, req *v1.NodeAPIRequest) (*v1.NodeMeta, error)
- func (s *Service) Notify(ctx context.Context, req *v1.Notify_Request) (*emptypb.Empty, error)
- func (s *Service) Realtime(ctx context.Context, req *v1.Realtime_Request) (*v1.Realtime_Response, error)
- func (s *Service) RemoveNode(ctx context.Context, req *v1.RemoveNode_Request) (*emptypb.Empty, error)
- func (s *Service) SendData(ctx context.Context, req *v1.Data) (*emptypb.Empty, error)
- func (s *Service) SetAPIAddr(addr string)
- func (s *Service) Timeseries(ctx context.Context, req *v1.Timeseries_Request) (*v1.Timeseries_Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CredentialsFor ¶
func CredentialsFor(credStr *auth.CredentialsStore, username string) *v1.Credentials
CredentialsFor returns a Credentials instance for the given username, or nil if the given CredentialsStore is nil, or the username is not found.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client allows communicating with a remote node.
func NewClient ¶
func NewClient(mgr *connections.Manager) *Client
NewClient returns a client instance for talking to a remote node. Clients will retry certain commands if they fail, to allow for remote node restarts. Cluster management operations such as joining and removing nodes are not retried, to make it clear to the operator that the operation failed. In addition, higher-level code will usually retry these operations.
func (*Client) Aggregate ¶
func (c *Client) Aggregate(ctx context.Context, req *v1.Aggregate_Request, nodeAddr string, creds *v1.Credentials) (*v1.Aggregate_Response, error)
func (*Client) Breakdown ¶
func (c *Client) Breakdown(ctx context.Context, req *v1.BreakDown_Request, nodeAddr string, creds *v1.Credentials) (*v1.BreakDown_Response, error)
func (*Client) GetNodeAPIAddr ¶
GetNodeAPIAddr retrieves the API Address for the node at nodeAddr
func (*Client) Join ¶
func (c *Client) Join(ctx context.Context, req *v1.Join_Request, nodeAddr string, creds *v1.Credentials) error
func (*Client) Load ¶
func (c *Client) Load(ctx context.Context, req *v1.Load_Request, nodeAddr string, creds *v1.Credentials) error
func (*Client) Notify ¶
func (c *Client) Notify(ctx context.Context, req *v1.Notify_Request, nodeAddr string, creds *v1.Credentials) error
func (*Client) Realtime ¶
func (c *Client) Realtime(ctx context.Context, req *v1.Realtime_Request, nodeAddr string, creds *v1.Credentials) (*v1.Realtime_Response, error)
func (*Client) RemoveNode ¶
func (c *Client) RemoveNode(ctx context.Context, req *v1.RemoveNode_Request, nodeAddr string, creds *v1.Credentials) error
func (*Client) Status ¶
func (c *Client) Status() *v1.Status_Cluster
Stats returns stats on the Client instance
func (*Client) Timeseries ¶
func (c *Client) Timeseries(ctx context.Context, req *v1.Timeseries_Request, nodeAddr string, creds *v1.Credentials) (*v1.Timeseries_Response, error)
type CredentialStore ¶
type CredentialStore interface { // AA authenticates and checks authorization for the given perm. AA(username, password string, perm v1.Credential_Permission) bool }
CredentialStore is the interface credential stores must support.
type Interceptor ¶
type Interceptor struct {
CredentialStore
}
func (*Interceptor) Stream ¶
func (c *Interceptor) Stream(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
func (*Interceptor) Unary ¶
func (c *Interceptor) Unary(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)
type Klient ¶
type Klient struct { *grpc.ClientConn v1.InternalCLusterClient }
type Service ¶
type Service struct { v1.UnsafeInternalCLusterServer // contains filtered or unexported fields }
Service provides information about the node and cluster.
func (*Service) Aggregate ¶
func (s *Service) Aggregate(ctx context.Context, req *v1.Aggregate_Request) (*v1.Aggregate_Response, error)
func (*Service) Backup ¶
func (s *Service) Backup(req *v1.Backup_Request, svr v1.InternalCLuster_BackupServer) error
func (*Service) BreakDown ¶
func (s *Service) BreakDown(ctx context.Context, req *v1.BreakDown_Request) (*v1.BreakDown_Response, error)
func (*Service) EnableHTTPS ¶
EnableHTTPS tells the cluster service the API serves HTTPS.
func (*Service) GetAPIAddr ¶
GetAPIAddr returns the previously-set API address
func (*Service) GetNodeAPIURL ¶
GetNodeAPIURL returns fully-specified HTTP(S) API URL for the node running this service.
func (*Service) Join ¶
func (s *Service) Join(ctx context.Context, req *v1.Join_Request) (*v1.Join_Response, error)
func (*Service) Realtime ¶
func (s *Service) Realtime(ctx context.Context, req *v1.Realtime_Request) (*v1.Realtime_Response, error)
func (*Service) RemoveNode ¶
func (*Service) SetAPIAddr ¶
SetAPIAddr sets the API address the cluster service returns.
func (*Service) Timeseries ¶
func (s *Service) Timeseries(ctx context.Context, req *v1.Timeseries_Request) (*v1.Timeseries_Response, error)
Directories ¶
Path | Synopsis |
---|---|
Package auth is a lightweight credential store.
|
Package auth is a lightweight credential store. |
Package transport provides a Transport for github.com/hashicorp/raft over gRPC.
|
Package transport provides a Transport for github.com/hashicorp/raft over gRPC. |