Documentation ¶
Index ¶
- func NewGroupStore(addr string, concurrency int, ftlsConfig *ftls.Config, opts ...grpc.DialOption) store.GroupStore
- func NewValueStore(addr string, concurrency int, ftlsConfig *ftls.Config, opts ...grpc.DialOption) store.ValueStore
- type GroupStoreConfig
- type PoolGroupStore
- func (ps *PoolGroupStore) AuditPass(ctx context.Context) error
- func (ps *PoolGroupStore) Delete(ctx context.Context, keyA uint64, keyB uint64, childKeyA uint64, ...) (int64, error)
- func (ps *PoolGroupStore) DisableWrites(ctx context.Context) error
- func (ps *PoolGroupStore) EnableWrites(ctx context.Context) error
- func (ps *PoolGroupStore) Flush(ctx context.Context) error
- func (ps *PoolGroupStore) Lookup(ctx context.Context, keyA uint64, keyB uint64, childKeyA uint64, ...) (int64, uint32, error)
- func (ps *PoolGroupStore) LookupGroup(ctx context.Context, parentKeyA, parentKeyB uint64) ([]store.LookupGroupItem, error)
- func (ps *PoolGroupStore) Read(ctx context.Context, keyA uint64, keyB uint64, childKeyA uint64, ...) (int64, []byte, error)
- func (ps *PoolGroupStore) ReadGroup(ctx context.Context, parentKeyA, parentKeyB uint64) ([]store.ReadGroupItem, error)
- func (ps *PoolGroupStore) Shutdown(ctx context.Context) error
- func (ps *PoolGroupStore) Startup(ctx context.Context) error
- func (ps *PoolGroupStore) Stats(ctx context.Context, debug bool) (fmt.Stringer, error)
- func (ps *PoolGroupStore) ValueCap(ctx context.Context) (uint32, error)
- func (ps *PoolGroupStore) Write(ctx context.Context, keyA uint64, keyB uint64, childKeyA uint64, ...) (int64, error)
- type PoolValueStore
- func (ps *PoolValueStore) AuditPass(ctx context.Context) error
- func (ps *PoolValueStore) Delete(ctx context.Context, keyA uint64, keyB uint64, timestampMicro int64) (int64, error)
- func (ps *PoolValueStore) DisableWrites(ctx context.Context) error
- func (ps *PoolValueStore) EnableWrites(ctx context.Context) error
- func (ps *PoolValueStore) Flush(ctx context.Context) error
- func (ps *PoolValueStore) Lookup(ctx context.Context, keyA uint64, keyB uint64) (int64, uint32, error)
- func (ps *PoolValueStore) Read(ctx context.Context, keyA uint64, keyB uint64, value []byte) (int64, []byte, error)
- func (ps *PoolValueStore) Shutdown(ctx context.Context) error
- func (ps *PoolValueStore) Startup(ctx context.Context) error
- func (ps *PoolValueStore) Stats(ctx context.Context, debug bool) (fmt.Stringer, error)
- func (ps *PoolValueStore) ValueCap(ctx context.Context) (uint32, error)
- func (ps *PoolValueStore) Write(ctx context.Context, keyA uint64, keyB uint64, timestampMicro int64, ...) (int64, 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 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 ReplValueStoreError
- type ReplValueStoreErrorNotFound
- type ReplValueStoreErrorSlice
- type ValueStoreConfig
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
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
NewValueStore creates a ValueStore connection via grpc to the given address.
Types ¶
type GroupStoreConfig ¶
type GroupStoreConfig struct { // Logger defines where log output will go. If not set, the logger will // default to zap.New(zap.NewJSONEncoder()). Logger zap.Logger // 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 // PoolSize sets how many store connections can be used per store endpoint. PoolSize int // ConcurrentRequestsPerStore defines the concurrent requests per // underlying connected store. Default: 1000 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 }
GroupStoreConfig defines the settings when calling NewGroupStore.
type PoolGroupStore ¶
type PoolGroupStore struct {
// contains filtered or unexported fields
}
func NewPoolGroupStore ¶
func NewPoolGroupStore(addr string, size int, concurrency int, ftlsConfig *ftls.Config, opts ...grpc.DialOption) *PoolGroupStore
func (*PoolGroupStore) DisableWrites ¶
func (ps *PoolGroupStore) DisableWrites(ctx context.Context) error
func (*PoolGroupStore) EnableWrites ¶
func (ps *PoolGroupStore) EnableWrites(ctx context.Context) error
func (*PoolGroupStore) LookupGroup ¶
func (ps *PoolGroupStore) LookupGroup(ctx context.Context, parentKeyA, parentKeyB uint64) ([]store.LookupGroupItem, error)
func (*PoolGroupStore) ReadGroup ¶
func (ps *PoolGroupStore) ReadGroup(ctx context.Context, parentKeyA, parentKeyB uint64) ([]store.ReadGroupItem, error)
type PoolValueStore ¶
type PoolValueStore struct {
// contains filtered or unexported fields
}
func NewPoolValueStore ¶
func NewPoolValueStore(addr string, size int, concurrency int, ftlsConfig *ftls.Config, opts ...grpc.DialOption) *PoolValueStore
func (*PoolValueStore) DisableWrites ¶
func (ps *PoolValueStore) DisableWrites(ctx context.Context) error
func (*PoolValueStore) EnableWrites ¶
func (ps *PoolValueStore) EnableWrites(ctx context.Context) error
type ReplGroupStore ¶
type ReplGroupStore struct {
// contains filtered or unexported fields
}
func NewReplGroupStore ¶
func NewReplGroupStore(c *GroupStoreConfig) *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 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 *ValueStoreConfig) *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 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
type ValueStoreConfig ¶
type ValueStoreConfig struct { // Logger defines where log output will go. If not set, the logger will // default to zap.New(zap.NewJSONEncoder()). Logger zap.Logger // 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 // PoolSize sets how many store connections can be used per store endpoint. PoolSize int // ConcurrentRequestsPerStore defines the concurrent requests per // underlying connected store. Default: 1000 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 }
ValueStoreConfig defines the settings when calling NewValueStore.
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. |