service

package
v0.0.0-...-23bfcb2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package service defines all the business logic of the program.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fib

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

func NewFib

func NewFib(cache *cache.Cache, options ...Option) *Fib

func (*Fib) Current

func (f *Fib) Current(id string) string

func (*Fib) FlushToFile

func (f *Fib) FlushToFile(filename string) (err error)

FlushToFile flushes everything that we have in the cache to disk.

func (*Fib) LoadFromFile

func (f *Fib) LoadFromFile(filename string) (err error)

LoadFromFile loads the cache memory from the storage file given by the filename. If it's empty it's no-op. If it doesn't exist, it will create it.

func (*Fib) Next

func (f *Fib) Next(id string) string

func (*Fib) Previous

func (f *Fib) Previous(id string) string

type Option

type Option func(f *Fib)

Option type used to define custom setters to customize the Fib implementation.

func WithLogger

func WithLogger(log *slog.Logger) Option

WithLogger set's a custom logger

Jump to

Keyboard shortcuts

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