cache

package
v0.0.0-...-84faedb Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(config *config.Config)

Types

type Cert

type Cert struct {
	Id          uint64 `json:"id"`
	Domain      string `json:"domain"`
	Certificate string `json:"certificate"`
	PrivateKey  string `json:"private_key"`
	Target      string `json:"target"`
	TlS         tls.Certificate
}

type Data

type Data struct {
	Certs []Cert `json:"certs"`
}

type MemoryCache

type MemoryCache struct {
	DB             sync.Map
	LastCertNumber uint64
	Config         *config.Config
}
var GlobalCache *MemoryCache

func (*MemoryCache) Delete

func (c *MemoryCache) Delete(key string)

Delete deletes the value for the given key.

func (*MemoryCache) Get

func (c *MemoryCache) Get(domain string) (*Cert, bool)

Get returns the value for the given key.

func (*MemoryCache) Set

func (c *MemoryCache) Set(domain string, value Cert) bool

Set sets the value for the given key.

func (*MemoryCache) SetRange

func (c *MemoryCache) SetRange(certs *[]Cert) error

SetRange setRange

Jump to

Keyboard shortcuts

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