contactcache

package
v0.0.0-...-6f11ede Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	Set(ctx context.Context, key, value string, ttl time.Duration) error
	Get(ctx context.Context, key string) (string, error)
	Delete(ctx context.Context, key string) error
}

Cacher interfaces to a caching server such as redis/memcached etc.

func NewRedisCache

func NewRedisCache() (Cacher, error)

NewRedisCache provides a redis backed cacher

type RedisCache

type RedisCache struct {
	// contains filtered or unexported fields
}

RedisCache basic redis backend driver

func (*RedisCache) Delete

func (rc *RedisCache) Delete(ctx context.Context, key string) error

Delete removes a value by key

func (*RedisCache) Get

func (rc *RedisCache) Get(ctx context.Context, key string) (string, error)

Get gets a value from the cache

func (*RedisCache) Set

func (rc *RedisCache) Set(ctx context.Context, key, value string, ttl time.Duration) error

Set sets a cache key

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server primary content server

func NewServer

func NewServer() (*Server, error)

NewServer creates a new instance of the middleware

func (*Server) Start

func (s *Server) Start() error

Start starts serving https requests

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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