apq

package
v0.0.0-...-d425aa1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 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 Client

type Client interface {
	Enabled() bool
	PersistedOperation(ctx context.Context, clientName string, sha256Hash string) ([]byte, error)
	SaveOperation(ctx context.Context, clientName, sha256Hash string, operationBody []byte) error
	Close()
}

func NewClient

func NewClient(opts *Options) (Client, error)

type KVClient

type KVClient interface {
	// Get retrieves the operation body from the KV store with the given operation hash as the key
	Get(ctx context.Context, operationHash string) ([]byte, error)
	// Set saves the operation body in the KV store with the given operation hash as the key and the ttl in seconds
	Set(ctx context.Context, operationHash string, operationBody []byte, ttl int) error
	// Close closes the KV store connection
	Close()
}

func NewRedisClient

func NewRedisClient(opts *RedisOptions) (KVClient, error)

type Options

type Options struct {
	Logger    *zap.Logger
	ApqConfig *config.AutomaticPersistedQueriesConfig
	KVClient  KVClient
}

type PersistedOperation

type PersistedOperation struct {
	Version int    `json:"version"`
	Body    string `json:"body"`
}

type RedisOptions

type RedisOptions struct {
	Logger        *zap.Logger
	StorageConfig *config.BaseStorageProvider
	ApqConfig     *config.AutomaticPersistedQueriesConfig
	Prefix        string
}

Jump to

Keyboard shortcuts

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