Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { Config // contains filtered or unexported fields }
Agent orchestrates the different components of our commit log service. It runs on every instance of our service.
func New ¶
Constructs a new Agent instance. It take the following steps for setting up an Agent: Setup application logging, created data-structures for the commit log, setup the RPC server and finally start the cluster membership manager. Returns any error which occurs during the membership setup, nil otherwise.
func (*Agent) Shutdown ¶
Shuts down the commit log service agent. The following steps are taken: Leave Cluster, Stop record replication, gracefully stop RPC server, cleanup data structures for the commit log. This method retains the files written by the log service since they might be necessary for data recovery. Returns any error which occurs during the shutdown process, nil otherwise.
type Config ¶
type Config struct { ServerTLSConfig *tls.Config // TLS authentication config for server PeerTLSConfig *tls.Config // TLS authentication config for peers DataDir string // Data directory for storing log records BindAddr string // Address of socket used for listening to cluster membership events RPCPort int // Port used for serving log service GRPC requests NodeName string // Node name to use for cluster membership StartJoinAddrs []string // Addresses of nodes from the cluster. Used for joining the cluster Bootstrap bool // Set on leader to bootstrap Raft cluster. ACLModelFile string // Access control list model file for authorization ACLPolicyFile string // Access control list policy file for authorization }
Represents the configuration for our Agent.