solanacache

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*SolanaClientCacheWrapper)

Option is a function that configures the SolanaClientCacheWrapper

func WithCacheClient

func WithCacheClient(cache *cache.Cache) Option

WithCacheClient sets the cache client

func WithCacheTTL

func WithCacheTTL(ttl time.Duration) Option

WithCacheTTL sets the cache ttl

func WithLogger added in v0.1.3

func WithLogger(log logger) Option

WithLogger sets the logger

func WithRedisClient

func WithRedisClient(redisClient *redis.Client) Option

WithRedisClient inits cache client with given redis connection.

func WithRedisConnectionURL

func WithRedisConnectionURL(redisConnURL string) Option

WithRedisConnectionURL init redis connection and cache client with it.

type SolanaClientCacheWrapper

type SolanaClientCacheWrapper struct {
	*client.Client
	// contains filtered or unexported fields
}

SolanaClientCacheWrapper is a wrapper for solana client

func NewSolanaClientCacheWrapper

func NewSolanaClientCacheWrapper(c *client.Client, opts ...Option) *SolanaClientCacheWrapper

NewSolanaClientCacheWrapper creates a new instance of SolanaClientCacheWrapper

func (*SolanaClientCacheWrapper) GetTokenMetadata

func (c *SolanaClientCacheWrapper) GetTokenMetadata(ctx context.Context, base58MintAddr string) (*token_metadata.Metadata, error)

GetTokenMetadata returns token metadata. It is used to cache the result of the solana client method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL