Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCacheCobraCommand() *cobra.Command
- func Server(ctx context.Context, listenAddr string, metricsAddr string, ...)
- type CacheMetrics
- type CacheServer
- type CacheValue
- type LastestCacheStore
- type RelayerCacheServer
- func (s *RelayerCacheServer) GetRelay(ctx context.Context, relayCacheGet *pairingtypes.RelayCacheGet) (cacheReply *pairingtypes.CacheRelayReply, err error)
- func (s *RelayerCacheServer) Health(ctx context.Context, req *emptypb.Empty) (*pairingtypes.CacheUsage, error)
- func (s *RelayerCacheServer) PrintCacheStats(ctx context.Context, desc string)
- func (s *RelayerCacheServer) SetRelay(ctx context.Context, relayCacheSet *pairingtypes.RelayCacheSet) (*emptypb.Empty, error)
Constants ¶
View Source
const ( FlagLogLevel = "log_level" FlagMetricsAddress = "metrics_address" )
View Source
const ( ExpirationFlagName = "expiration" ExpirationNonFinalizedFlagName = "expiration-non-finalized" FlagCacheSizeName = "max-items" FlagUseMethodInApiSpecificCacheMetricsName = "use-method-in-cache-metrics" DefaultExpirationForNonFinalized = 500 * time.Millisecond DefaultExpirationTimeFinalized = time.Hour CacheNumCounters = 100000000 // expect 10M items )
View Source
const (
DisabledFlagOption = "disabled"
)
View Source
const (
SEP = ";"
)
Variables ¶
View Source
var ( NotFoundError = sdkerrors.New("Cache miss", 1, "cache entry for specific block and request wasn't found") // client could'nt connect to any provider. HashMismatchError = sdkerrors.New("Cache hit but hash mismatch", 2, "cache entry for specific block and request had a mismatching hash stored") // client could'nt connect to any provider. EntryTypeError = sdkerrors.New("Cache hit but entry is a different object", 3, "cache entry for specific block and request had a mismatching object stored") // client could'nt connect to any provider. )
Functions ¶
func CreateCacheCobraCommand ¶
Types ¶
type CacheMetrics ¶
type CacheMetrics struct {
// contains filtered or unexported fields
}
func NewCacheMetricsServer ¶
func NewCacheMetricsServer(listenAddress string, useMethodInApiSpecificMetric bool) *CacheMetrics
func (*CacheMetrics) AddApiSpecific ¶
type CacheServer ¶
type CacheServer struct { ExpirationFinalized time.Duration ExpirationNonFinalized time.Duration CacheMetrics *CacheMetrics CacheMaxCost int64 // contains filtered or unexported fields }
func (*CacheServer) ExpirationForChain ¶
func (cs *CacheServer) ExpirationForChain(chainID string) time.Duration
type CacheValue ¶
type CacheValue struct { Response pairingtypes.RelayReply Hash []byte OptionalMetadata []pairingtypes.Metadata }
func (*CacheValue) Cost ¶
func (cv *CacheValue) Cost() int64
func (*CacheValue) ToCacheReply ¶
func (cv *CacheValue) ToCacheReply() *pairingtypes.CacheRelayReply
type LastestCacheStore ¶
type LastestCacheStore struct {
// contains filtered or unexported fields
}
func (*LastestCacheStore) Cost ¶
func (cv *LastestCacheStore) Cost() int64
type RelayerCacheServer ¶
type RelayerCacheServer struct { pairingtypes.UnimplementedRelayerCacheServer CacheServer *CacheServer // contains filtered or unexported fields }
func (*RelayerCacheServer) GetRelay ¶
func (s *RelayerCacheServer) GetRelay(ctx context.Context, relayCacheGet *pairingtypes.RelayCacheGet) (cacheReply *pairingtypes.CacheRelayReply, err error)
func (*RelayerCacheServer) Health ¶
func (s *RelayerCacheServer) Health(ctx context.Context, req *emptypb.Empty) (*pairingtypes.CacheUsage, error)
func (*RelayerCacheServer) PrintCacheStats ¶
func (s *RelayerCacheServer) PrintCacheStats(ctx context.Context, desc string)
func (*RelayerCacheServer) SetRelay ¶
func (s *RelayerCacheServer) SetRelay(ctx context.Context, relayCacheSet *pairingtypes.RelayCacheSet) (*emptypb.Empty, error)
Click to show internal directories.
Click to hide internal directories.