func ConfigureLogger()
func LoadClientClientCommonNameForFiles(certFile string, keyFile string) (shared.ClientCommonName, error)
func LoadClientTLSCredentials(certFile string, keyFile string, caFile string) (credentials.TransportCredentials, error)
type ClientConfig struct {
ReaderAddress string
ReaderClient readerp.ReaderClient
ReaderHealthClient healthp.HealthClient
ReaderStatusClient statusp.StatusProviderClient
WriterAddress string
WriterClient writerp.WriterClient
WriterHealthClient healthp.HealthClient
WriterStatusClient statusp.StatusProviderClient
ZkAddress string
// Certs
CertFile string
KeyFile string
CaFile string
}
func (cc *ClientConfig) ReadQueueCapacity() int
ReadQueueCapacity returns the capacity of the read queue. Reads initiated using *Async methods are added to the read queue. Every n ms, or when the read queue fills, whichever is sooner, the client sends all queries in the read queue to the server in a batch. By design, the user cannot trigger a batch to me sent but must wait for a response on the channel(s) returned by the *Async methods.
func (cc *ClientConfig) WriteQueueCapacity() int
WriteQueueCapacity returns the capacity of the write queue. Writes initiated using *Async methods are added to the write queue. Every n ms, or when the write queue fills, whichever is sooner, the client sends all queries in the write queue to the server in a batch. By design, the user cannot trigger a batch to me sent but must wait for a response on the channel(s) returned by the *Async methods.
type ClientYamlConfig struct {
Client struct {
CertFile string `yaml:"certFile" env:"CLIENT_CERT_FILE" env-description:"Absolute path to the client certificate file"`
KeyFile string `yaml:"keyFile" env:"CLIENT_KEY_FILE" env-description:"Absolute path to the client key file"`
CAFile string `yaml:"caFile" env:"CLIENT_CA_FILE" env-description:"Absolute path to the CA file"`
Log string `yaml:"log" env:"CLIENT_LOG" env-description:"Client log" env-default:"/tmp/twicedb.go-client.log"`
ReadQueueCapacity int `yaml:"readQueueCapacity" env:"CLIENT_READ_QUEUE_CAPACITY" env-description:"Capacity of the read queue" env-default:"100"`
WriteQueueCapacity int `yaml:"writeQueueCapacity" env:"CLIENT_WRITE_QUEUE_CAPACITY" env-description:"Capacity of the write queue" env-default:"100"`
MinCompressionSizeInBytes int `yaml:"minCompressionSizeInBytes" env:"MIN_COMPRESSION_SIZE_IN_BYTES" env-description:"Minimum size (in bytes) of object to compress" env-default:"129"`
}
Server struct {
// Oddly, localhost:50004 doesn't work. Maybe localhost doesn't map to an
// IP address?
ReaderAddress string `yaml:"readerAddress" env:"CLIENT_READER_ADDRESS" env-description:"Reader host:port" env-default:"0.0.0.0:50004"`
WriterAddress string `yaml:"writerAddress" env:"CLIENT_WRITER_ADDRESS" env-description:"Writer host:port" env-default:"0.0.0.0:50004"`
Shard int `yaml:"shard" env:"CLIENT_SHARD" env-description:"Client's assigned shard number"`
ZkAddress string `yaml:"zkAddress" env:"CLIENT_ZK_ADDRESS" env-description:"Zk host:port" env-default:"zk://0.0.0.0:2281"`
}
}
func ClientYamlCfg() ClientYamlConfig