caches

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeStandalone = "standalone"
	ModeCluster    = "cluster"
	ModeRing       = "ring"
)

Variables

Functions

func HostAndPortArrayToStringArray

func HostAndPortArrayToStringArray(servers []HostAndPort) []string

Types

type Disk

type Disk struct {
	DiskConfig
}

func (Disk) Lookup

func (c Disk) Lookup(t pkg.TileRequest) (*pkg.Image, error)

func (Disk) Save

func (c Disk) Save(t pkg.TileRequest, img *pkg.Image) error

type DiskConfig

type DiskConfig struct {
	Path     string
	FileMode uint32
}

type DiskRegistration added in v0.5.0

type DiskRegistration struct {
}

func (DiskRegistration) Initialize added in v0.5.0

func (s DiskRegistration) Initialize(configAny any, errorMessages config.ErrorMessages) (cache.Cache, error)

func (DiskRegistration) InitializeConfig added in v0.5.0

func (s DiskRegistration) InitializeConfig() any

func (DiskRegistration) Name added in v0.5.0

func (s DiskRegistration) Name() string

type HostAndPort

type HostAndPort struct {
	Host string
	Port uint16
}

Utility type used in a couple caches

func (HostAndPort) String

func (hp HostAndPort) String() string

type Memcache

type Memcache struct {
	MemcacheConfig
	// contains filtered or unexported fields
}

func (Memcache) Lookup

func (c Memcache) Lookup(t pkg.TileRequest) (*pkg.Image, error)

func (Memcache) Save

func (c Memcache) Save(t pkg.TileRequest, img *pkg.Image) error

type MemcacheConfig

type MemcacheConfig struct {
	HostAndPort `mapstructure:",squash"`
	Servers     []HostAndPort // The list of servers to use.
	KeyPrefix   string        // Prefix to keynames stored in cache
	TTL         uint32        // Cache expiration in seconds. Max of 30 days. Default to 1 day
}

type MemcacheRegistration added in v0.5.0

type MemcacheRegistration struct {
}

func (MemcacheRegistration) Initialize added in v0.5.0

func (s MemcacheRegistration) Initialize(configAny any, errorMessages config.ErrorMessages) (cache.Cache, error)

func (MemcacheRegistration) InitializeConfig added in v0.5.0

func (s MemcacheRegistration) InitializeConfig() any

func (MemcacheRegistration) Name added in v0.5.0

func (s MemcacheRegistration) Name() string

type Memory

type Memory struct {
	MemoryConfig
	Cache otter.Cache[string, []byte]
}

func (Memory) Lookup

func (c Memory) Lookup(t pkg.TileRequest) (*pkg.Image, error)

func (Memory) Save

func (c Memory) Save(t pkg.TileRequest, img *pkg.Image) error

type MemoryConfig

type MemoryConfig struct {
	MaxSize uint16 // Maximum number of tiles to hold in the cache. Defaults to 100
	TTL     uint32 // Maximum time to live of a tile in seconds. Defaults to 3600 (1 hour)
}

type MemoryRegistration added in v0.5.0

type MemoryRegistration struct {
}

func (MemoryRegistration) Initialize added in v0.5.0

func (s MemoryRegistration) Initialize(configAny any, _ config.ErrorMessages) (cache.Cache, error)

func (MemoryRegistration) InitializeConfig added in v0.5.0

func (s MemoryRegistration) InitializeConfig() any

func (MemoryRegistration) Name added in v0.5.0

func (s MemoryRegistration) Name() string

type Multi

type Multi struct {
	Tiers []cache.Cache
}

func (Multi) Lookup

func (c Multi) Lookup(t pkg.TileRequest) (*pkg.Image, error)

func (Multi) Save

func (c Multi) Save(t pkg.TileRequest, img *pkg.Image) error

type MultiConfig

type MultiConfig struct {
	Tiers []map[string]interface{}
}

type MultiRegistration added in v0.5.0

type MultiRegistration struct {
}

func (MultiRegistration) Initialize added in v0.5.0

func (s MultiRegistration) Initialize(configAny any, errorMessages config.ErrorMessages) (cache.Cache, error)

func (MultiRegistration) InitializeConfig added in v0.5.0

func (s MultiRegistration) InitializeConfig() any

func (MultiRegistration) Name added in v0.5.0

func (s MultiRegistration) Name() string

type Noop

type Noop struct {
	NoopConfig
}

func (Noop) Lookup

func (c Noop) Lookup(_ pkg.TileRequest) (*pkg.Image, error)

func (Noop) Save

func (c Noop) Save(_ pkg.TileRequest, _ *pkg.Image) error

type NoopConfig added in v0.5.0

type NoopConfig struct {
}

type NoopRegistration added in v0.5.0

type NoopRegistration struct {
}

func (NoopRegistration) Initialize added in v0.5.0

func (s NoopRegistration) Initialize(configAny any, _ config.ErrorMessages) (cache.Cache, error)

func (NoopRegistration) InitializeConfig added in v0.5.0

func (s NoopRegistration) InitializeConfig() any

func (NoopRegistration) Name added in v0.5.0

func (s NoopRegistration) Name() string

type Redis

type Redis struct {
	RedisConfig
	// contains filtered or unexported fields
}

func (Redis) Lookup

func (c Redis) Lookup(t pkg.TileRequest) (*pkg.Image, error)

func (Redis) Save

func (c Redis) Save(t pkg.TileRequest, img *pkg.Image) error

type RedisConfig

type RedisConfig struct {
	HostAndPort `mapstructure:",squash"` // Host and Port for a single server. A convenience equivalent to supplying Servers with a single entry
	DB          int                      // Database number, defaults to 0
	KeyPrefix   string                   // Prefix to keynames stored in cache
	Username    string                   // Username to use to authenticate
	Password    string                   // Password to use to authenticate
	Mode        string                   // Controls operating mode. One of AllModes. Defaults to standalone
	TTL         uint32                   // Cache expiration in seconds. Max of 1 year. Default to 1 day
	Servers     []HostAndPort            // The list of servers to use.
}

type RedisRegistration added in v0.5.0

type RedisRegistration struct {
}

func (RedisRegistration) Initialize added in v0.5.0

func (s RedisRegistration) Initialize(configAny any, errorMessages config.ErrorMessages) (cache.Cache, error)

func (RedisRegistration) InitializeConfig added in v0.5.0

func (s RedisRegistration) InitializeConfig() any

func (RedisRegistration) Name added in v0.5.0

func (s RedisRegistration) Name() string

type S3

type S3 struct {
	S3Config
	// contains filtered or unexported fields
}

func (S3) Lookup

func (c S3) Lookup(t pkg.TileRequest) (*pkg.Image, error)

func (S3) Save

func (c S3) Save(t pkg.TileRequest, img *pkg.Image) error

type S3Config

type S3Config struct {
	Bucket       string
	Access       string
	Secret       string
	Region       string
	Path         string
	Profile      string
	StorageClass string
	Endpoint     string // For directory buckets or non-s3
	UsePathStyle bool   // For testing purposes and maybe real non-S3 usage
}

type S3Registration added in v0.5.0

type S3Registration struct {
}

func (S3Registration) Initialize added in v0.5.0

func (s S3Registration) Initialize(configAny any, errorMessages config.ErrorMessages) (cache.Cache, error)

func (S3Registration) InitializeConfig added in v0.5.0

func (s S3Registration) InitializeConfig() any

func (S3Registration) Name added in v0.5.0

func (s S3Registration) Name() string

Jump to

Keyboard shortcuts

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