app

package
v0.0.0-...-05d7838 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute executes the root command.

Types

type Config

type Config struct {
	Version       string `mapstructure:"version"`
	UseCache      bool   `mapstructure:"use_cache"`
	UseDirtyWrite bool   `mapstructure:"use_dirty_write"`
	Redis         struct {
		Port     string      `mapstructure:"port"`
		Bind     string      `mapstructure:"bind"`
		Password interface{} `mapstructure:"password"`
	} `mapstructure:"redis"`
	S3 struct {
		Version   string `mapstructure:"version"`
		Bucket    string `mapstructure:"bucket"`
		Region    string `mapstructure:"region"`
		AccessKey string `mapstructure:"access_key"`
		SecretKey string `mapstructure:"secret_key"`
		Prefix    string `mapstructure:"prefix"`
		Endpoint  string `mapstructure:"endpoint"`
	} `mapstructure:"s3"`
}

type Redis

type Redis struct {
	UseCache      bool
	UseDirtyWrite bool
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis(s3 *S3, config Config) *Redis

func (*Redis) Delete

func (r *Redis) Delete(ctx context.Context, key string) error

func (*Redis) Get

func (r *Redis) Get(ctx context.Context, key string) ([]byte, error)

func (*Redis) Handler

func (r *Redis) Handler(conn redcon.Conn, cmd redcon.Command)

func (*Redis) Keys

func (r *Redis) Keys(ctx context.Context, key string) ([]string, error)

func (*Redis) Set

func (r *Redis) Set(ctx context.Context, key string, value []byte) error

type S3

type S3 struct {
	Client *minio.Client
	// contains filtered or unexported fields
}

func NewS3

func NewS3(config Config) *S3

func (*S3) Delete

func (s *S3) Delete(ctx context.Context, key string) error

func (*S3) Get

func (s *S3) Get(ctx context.Context, key string) ([]byte, error)

func (*S3) List

func (s *S3) List(ctx context.Context, key string) ([]string, error)

func (*S3) Put

func (s *S3) Put(ctx context.Context, key string, value []byte) error

type Server

type Server struct {
	Config Config
	S3     *S3
	Redis  *Redis
}

func NewServer

func NewServer(config Config, s3 *S3, redis *Redis) *Server

func (*Server) Run

func (s *Server) Run() error

Jump to

Keyboard shortcuts

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