loader

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRedisKey = "gost"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPLoaderOption

type HTTPLoaderOption func(opts *httpLoaderOptions)

func TimeoutHTTPLoaderOption

func TimeoutHTTPLoaderOption(timeout time.Duration) HTTPLoaderOption

type Lister

type Lister interface {
	List(ctx context.Context) ([]string, error)
}

type Loader

type Loader interface {
	Load(context.Context) (io.Reader, error)
	Close() error
}

func FileLoader

func FileLoader(filename string) Loader

FileLoader loads data from file.

func HTTPLoader

func HTTPLoader(url string, opts ...HTTPLoaderOption) Loader

HTTPLoader loads data from HTTP request.

func RedisHashLoader

func RedisHashLoader(addr string, opts ...RedisLoaderOption) Loader

RedisHashLoader loads data from redis hash.

func RedisListLoader

func RedisListLoader(addr string, opts ...RedisLoaderOption) Loader

RedisListLoader loads data from redis list.

func RedisSetLoader

func RedisSetLoader(addr string, opts ...RedisLoaderOption) Loader

RedisSetLoader loads data from redis set.

type Mapper

type Mapper interface {
	Map(ctx context.Context) (map[string]string, error)
}

type RedisLoaderOption

type RedisLoaderOption func(opts *redisLoaderOptions)

func DBRedisLoaderOption

func DBRedisLoaderOption(db int) RedisLoaderOption

func KeyRedisLoaderOption

func KeyRedisLoaderOption(key string) RedisLoaderOption

func PasswordRedisLoaderOption

func PasswordRedisLoaderOption(password string) RedisLoaderOption

Jump to

Keyboard shortcuts

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