Documentation
¶
Index ¶
- func NewGroupStore(addr string, concurrency int, ftlsConfig *ftls.Config, opts ...grpc.DialOption) (store.GroupStore, error)
- func NewValueStore(addr string, concurrency int, ftlsConfig *ftls.Config, opts ...grpc.DialOption) (store.ValueStore, error)
- type ReplGroupStore
- func (rs *ReplGroupStore) AuditPass(ctx context.Context) error
- func (rs *ReplGroupStore) Delete(ctx context.Context, keyA uint64, keyB uint64, childKeyA, childKeyB uint64, ...) (int64, error)
- func (rs *ReplGroupStore) DisableWrites(ctx context.Context) error
- func (rs *ReplGroupStore) EnableWrites(ctx context.Context) error
- func (rs *ReplGroupStore) Flush(ctx context.Context) error
- func (rs *ReplGroupStore) Lookup(ctx context.Context, keyA, keyB uint64, childKeyA, childKeyB uint64) (int64, uint32, error)
- func (rs *ReplGroupStore) LookupGroup(ctx context.Context, parentKeyA, parentKeyB uint64) ([]store.LookupGroupItem, error)
- func (rs *ReplGroupStore) Read(ctx context.Context, keyA uint64, keyB uint64, childKeyA, childKeyB uint64, ...) (int64, []byte, error)
- func (rs *ReplGroupStore) ReadGroup(ctx context.Context, parentKeyA, parentKeyB uint64) ([]store.ReadGroupItem, error)
- func (rs *ReplGroupStore) Ring(ctx context.Context) ring.Ring
- func (rs *ReplGroupStore) SetRing(r ring.Ring)
- func (rs *ReplGroupStore) Shutdown(ctx context.Context) error
- func (rs *ReplGroupStore) Startup(ctx context.Context) error
- func (rs *ReplGroupStore) Stats(ctx context.Context, debug bool) (fmt.Stringer, error)
- func (rs *ReplGroupStore) ValueCap(ctx context.Context) (uint32, error)
- func (rs *ReplGroupStore) Write(ctx context.Context, keyA uint64, keyB uint64, childKeyA, childKeyB uint64, ...) (int64, error)
- type ReplGroupStoreConfig
- type ReplGroupStoreError
- type ReplGroupStoreErrorNotFound
- type ReplGroupStoreErrorSlice
- type ReplValueStore
- func (rs *ReplValueStore) AuditPass(ctx context.Context) error
- func (rs *ReplValueStore) Delete(ctx context.Context, keyA uint64, keyB uint64, timestampMicro int64) (int64, error)
- func (rs *ReplValueStore) DisableWrites(ctx context.Context) error
- func (rs *ReplValueStore) EnableWrites(ctx context.Context) error
- func (rs *ReplValueStore) Flush(ctx context.Context) error
- func (rs *ReplValueStore) Lookup(ctx context.Context, keyA, keyB uint64) (int64, uint32, error)
- func (rs *ReplValueStore) Read(ctx context.Context, keyA uint64, keyB uint64, value []byte) (int64, []byte, error)
- func (rs *ReplValueStore) Ring(ctx context.Context) ring.Ring
- func (rs *ReplValueStore) SetRing(r ring.Ring)
- func (rs *ReplValueStore) Shutdown(ctx context.Context) error
- func (rs *ReplValueStore) Startup(ctx context.Context) error
- func (rs *ReplValueStore) Stats(ctx context.Context, debug bool) (fmt.Stringer, error)
- func (rs *ReplValueStore) ValueCap(ctx context.Context) (uint32, error)
- func (rs *ReplValueStore) Write(ctx context.Context, keyA uint64, keyB uint64, timestampMicro int64, ...) (int64, error)
- type ReplValueStoreConfig
- type ReplValueStoreError
- type ReplValueStoreErrorNotFound
- type ReplValueStoreErrorSlice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGroupStore ¶
func NewGroupStore(addr string, concurrency int, ftlsConfig *ftls.Config, opts ...grpc.DialOption) (store.GroupStore, error)
NewGroupStore creates a GroupStore connection via grpc to the given address.
func NewValueStore ¶
func NewValueStore(addr string, concurrency int, ftlsConfig *ftls.Config, opts ...grpc.DialOption) (store.ValueStore, error)
NewValueStore creates a ValueStore connection via grpc to the given address.
Types ¶
type ReplGroupStore ¶
type ReplGroupStore struct {
// contains filtered or unexported fields
}
func NewReplGroupStore ¶
func NewReplGroupStore(c *ReplGroupStoreConfig) *ReplGroupStore
func (*ReplGroupStore) DisableWrites ¶
func (rs *ReplGroupStore) DisableWrites(ctx context.Context) error
func (*ReplGroupStore) EnableWrites ¶
func (rs *ReplGroupStore) EnableWrites(ctx context.Context) error
func (*ReplGroupStore) LookupGroup ¶
func (rs *ReplGroupStore) LookupGroup(ctx context.Context, parentKeyA, parentKeyB uint64) ([]store.LookupGroupItem, error)
func (*ReplGroupStore) ReadGroup ¶
func (rs *ReplGroupStore) ReadGroup(ctx context.Context, parentKeyA, parentKeyB uint64) ([]store.ReadGroupItem, error)
func (*ReplGroupStore) SetRing ¶
func (rs *ReplGroupStore) SetRing(r ring.Ring)
func (*ReplGroupStore) Shutdown ¶
func (rs *ReplGroupStore) Shutdown(ctx context.Context) error
Shutdown will close all connections to backend stores and shutdown any running ring service connector. Note that the ReplGroupStore can still be used after Shutdown, it will just start reconnecting to backends again. To relaunch the ring service connector, you will need to call Startup.
func (*ReplGroupStore) Startup ¶
func (rs *ReplGroupStore) Startup(ctx context.Context) error
Startup is not required to use the ReplGroupStore; it will automatically connect to backend stores as needed. However, if you'd like to use the ring service to receive ring updates and have the ReplGroupStore automatically update itself accordingly, Startup will launch a connector to that service. Otherwise, you will need to call SetRing yourself to inform the ReplGroupStore of which backends to connect to.
type ReplGroupStoreConfig ¶
type ReplGroupStoreConfig struct { // LogError sets the func to use for error messages. Defaults to stderr. LogError func(fmt string, args ...interface{}) // LogDebug sets the func to use for debug messages. Defaults to not // logging debug messages. LogDebug func(fmt string, args ...interface{}) // AddressIndex indicates which of the ring node addresses to use when // connecting to a node (see github.com/gholt/ring/Node.Address). AddressIndex int // ValueCap defines the maximum value size supported by the set of stores. // This defaults to 0xffffffff, or math.MaxUint32. In order to discover the // true value cap, all stores would have to be queried and then the lowest // cap used. However, that's probably not really necessary and configuring // a set value cap here is probably fine. ValueCap uint32 // ConcurrentRequestsPerStore defines the concurrent requests per // underlying connected store. Default: 10 ConcurrentRequestsPerStore int // FailedConnectRetryDelay defines how many seconds must pass before // retrying a failed connection. Default: 15 seconds FailedConnectRetryDelay int // StoreFTLSConfig is the ftls config you want use to build a tls.Config for // each grpc client used to communicate to the Store. StoreFTLSConfig *ftls.Config // GRPCOpts are any additional reusable options you'd like to pass to GRPC // when connecting to stores. GRPCOpts []grpc.DialOption // RingServer is the network address to use to connect to a ring server. An // empty string will use the default DNS method of determining the ring // server location. RingServer string // RingServerGRPCOpts are any additional options you'd like to pass to GRPC // when connecting to the ring server. RingServerGRPCOpts []grpc.DialOption // RingClientID is a unique identifier for this client, used when // registering with the RingServer. This allows the ring server to // proactively clean up stale connections should a reconnection be needed. RingClientID string // RingCachePath is the full location file name where you'd like persist // last received ring data, such as "/var/lib/myprog/ring/valuestore.ring". // An empty string will disable caching. The cacher will need permission to // create a new file with the path given plus a temporary suffix, and will // then move that temporary file into place using the exact path given. RingCachePath string }
ReplGroupStoreConfig defines the settings when calling NewGroupStore.
type ReplGroupStoreError ¶
type ReplGroupStoreError interface { error Store() store.GroupStore Err() error }
type ReplGroupStoreErrorNotFound ¶
type ReplGroupStoreErrorNotFound ReplGroupStoreErrorSlice
func (ReplGroupStoreErrorNotFound) ErrNotFound ¶
func (e ReplGroupStoreErrorNotFound) ErrNotFound() string
func (ReplGroupStoreErrorNotFound) Error ¶
func (e ReplGroupStoreErrorNotFound) Error() string
type ReplGroupStoreErrorSlice ¶
type ReplGroupStoreErrorSlice []ReplGroupStoreError
func (ReplGroupStoreErrorSlice) Error ¶
func (es ReplGroupStoreErrorSlice) Error() string
type ReplValueStore ¶
type ReplValueStore struct {
// contains filtered or unexported fields
}
func NewReplValueStore ¶
func NewReplValueStore(c *ReplValueStoreConfig) *ReplValueStore
func (*ReplValueStore) DisableWrites ¶
func (rs *ReplValueStore) DisableWrites(ctx context.Context) error
func (*ReplValueStore) EnableWrites ¶
func (rs *ReplValueStore) EnableWrites(ctx context.Context) error
func (*ReplValueStore) SetRing ¶
func (rs *ReplValueStore) SetRing(r ring.Ring)
func (*ReplValueStore) Shutdown ¶
func (rs *ReplValueStore) Shutdown(ctx context.Context) error
Shutdown will close all connections to backend stores and shutdown any running ring service connector. Note that the ReplValueStore can still be used after Shutdown, it will just start reconnecting to backends again. To relaunch the ring service connector, you will need to call Startup.
func (*ReplValueStore) Startup ¶
func (rs *ReplValueStore) Startup(ctx context.Context) error
Startup is not required to use the ReplValueStore; it will automatically connect to backend stores as needed. However, if you'd like to use the ring service to receive ring updates and have the ReplValueStore automatically update itself accordingly, Startup will launch a connector to that service. Otherwise, you will need to call SetRing yourself to inform the ReplValueStore of which backends to connect to.
type ReplValueStoreConfig ¶
type ReplValueStoreConfig struct { // LogError sets the func to use for error messages. Defaults to stderr. LogError func(fmt string, args ...interface{}) // LogDebug sets the func to use for debug messages. Defaults to not // logging debug messages. LogDebug func(fmt string, args ...interface{}) // AddressIndex indicates which of the ring node addresses to use when // connecting to a node (see github.com/gholt/ring/Node.Address). AddressIndex int // ValueCap defines the maximum value size supported by the set of stores. // This defaults to 0xffffffff, or math.MaxUint32. In order to discover the // true value cap, all stores would have to be queried and then the lowest // cap used. However, that's probably not really necessary and configuring // a set value cap here is probably fine. ValueCap uint32 // ConcurrentRequestsPerStore defines the concurrent requests per // underlying connected store. Default: 10 ConcurrentRequestsPerStore int // FailedConnectRetryDelay defines how many seconds must pass before // retrying a failed connection. Default: 15 seconds FailedConnectRetryDelay int // StoreFTLSConfig is the ftls config you want use to build a tls.Config for // each grpc client used to communicate to the Store. StoreFTLSConfig *ftls.Config // GRPCOpts are any additional reusable options you'd like to pass to GRPC // when connecting to stores. GRPCOpts []grpc.DialOption // RingServer is the network address to use to connect to a ring server. An // empty string will use the default DNS method of determining the ring // server location. RingServer string // RingServerGRPCOpts are any additional options you'd like to pass to GRPC // when connecting to the ring server. RingServerGRPCOpts []grpc.DialOption // RingClientID is a unique identifier for this client, used when // registering with the RingServer. This allows the ring server to // proactively clean up stale connections should a reconnection be needed. RingClientID string // RingCachePath is the full location file name where you'd like persist // last received ring data, such as "/var/lib/myprog/ring/valuestore.ring". // An empty string will disable caching. The cacher will need permission to // create a new file with the path given plus a temporary suffix, and will // then move that temporary file into place using the exact path given. RingCachePath string }
ReplValueStoreConfig defines the settings when calling NewValueStore.
type ReplValueStoreError ¶
type ReplValueStoreError interface { error Store() store.ValueStore Err() error }
type ReplValueStoreErrorNotFound ¶
type ReplValueStoreErrorNotFound ReplValueStoreErrorSlice
func (ReplValueStoreErrorNotFound) ErrNotFound ¶
func (e ReplValueStoreErrorNotFound) ErrNotFound() string
func (ReplValueStoreErrorNotFound) Error ¶
func (e ReplValueStoreErrorNotFound) Error() string
type ReplValueStoreErrorSlice ¶
type ReplValueStoreErrorSlice []ReplValueStoreError
func (ReplValueStoreErrorSlice) Error ¶
func (es ReplValueStoreErrorSlice) Error() string
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package groupproto is a generated protocol buffer package.
|
Package groupproto is a generated protocol buffer package. |
Package valueproto is a generated protocol buffer package.
|
Package valueproto is a generated protocol buffer package. |