server

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity interface {
	Init(group fiber.Router)
	Name() string
}

type RedisIdempotency

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

func NewRedisIdempotency

func NewRedisIdempotency(c *redis.Client) *RedisIdempotency

func (RedisIdempotency) Close

func (r RedisIdempotency) Close() error

func (RedisIdempotency) Delete

func (r RedisIdempotency) Delete(key string) error

func (RedisIdempotency) Get

func (r RedisIdempotency) Get(key string) ([]byte, error)

func (RedisIdempotency) Reset

func (r RedisIdempotency) Reset() error

func (RedisIdempotency) Set

func (r RedisIdempotency) Set(key string, val []byte, exp time.Duration) error

type RedisLocker

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

func NewRedisLocker

func NewRedisLocker(c *redis.Client) *RedisLocker

func (RedisLocker) Lock

func (r RedisLocker) Lock(key string) error

func (RedisLocker) Unlock

func (r RedisLocker) Unlock(key string) error

type Server

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

func NewServer

func NewServer() *Server

func (*Server) AuthMiddleware

func (s *Server) AuthMiddleware(secret string)

func (*Server) Close

func (s *Server) Close() error

func (*Server) RateLimitMiddleware

func (s *Server) RateLimitMiddleware(limit, exp int)

func (*Server) RateLimitPipedMiddleware

func (s *Server) RateLimitPipedMiddleware(limit, exp int)

func (*Server) Register

func (s *Server) Register(base string, components ...Entity)

func (*Server) Start

func (s *Server) Start(addr string) error

func (*Server) Use

func (s *Server) Use(args ...interface{})

func (*Server) WithCORS

func (s *Server) WithCORS()

func (*Server) WithCache

func (s *Server) WithCache(c *vkc.Cache)

func (*Server) WithIdempotency

func (s *Server) WithIdempotency(client *redis.Client, lifetimeMinutes int64)

func (*Server) WithLogger

func (s *Server) WithLogger(logger *slog.Logger)

func (*Server) WithMetrics

func (s *Server) WithMetrics()

func (*Server) WithSwagger

func (s *Server) WithSwagger(app string)

type VKStorage

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

func NewVKStorage

func NewVKStorage(c cache.Cache) *VKStorage

func (*VKStorage) Close

func (s *VKStorage) Close() error

Close closes the storage and will stop any running garbage collectors and open connections.

func (*VKStorage) Delete

func (s *VKStorage) Delete(key string) error

Delete deletes the value for the given key. It returns no error if the storage does not contain the key,

func (*VKStorage) Get

func (s *VKStorage) Get(key string) ([]byte, error)

func (*VKStorage) Reset

func (s *VKStorage) Reset() error

Reset resets the storage and delete all keys.

func (*VKStorage) Set

func (s *VKStorage) Set(key string, val []byte, exp time.Duration) error

Set stores the given value for the given key along with an expiration value, 0 means no expiration. Empty key or value will be ignored without an error.

Jump to

Keyboard shortcuts

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