rule

package
v0.0.0-...-d46a54d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service interface {
	GetAll() domain.Rules
	GetRule(ID int64) (domain.Rule, bool)
	Save(domain.Rule) (domain.Rule, error)
	Remove(ID int64) bool
}

Service provides mock API functionality

func NewService

func NewService(logger *zerolog.Logger, storage Storage) Service

NewService creates instance of rule service

type Storage

type Storage interface {
	GetAll() domain.Rules
	GetRule(ID int64) (domain.Rule, bool)
	Save(domain.Rule) (domain.Rule, error)
	Remove(ID int64) bool
}

Storage provides storage for rules

func NewStorage

func NewStorage(logger *zerolog.Logger, rules domain.Rules, storageSize int, storageDuration time.Duration) Storage

NewStorage creates new instance of rule storage using cache as storage

Jump to

Keyboard shortcuts

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