store

package
v0.0.0-...-a93b974 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RString

func RString(r dnsmessage.Resource) string

RString resource to string

Types

type Entry

type Entry struct {
	Resources []dnsmessage.Resource
	TTL       uint32
	Created   int64
}

Entry entry struct

type Store

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Store store struct

func NewStore

func NewStore(rwDirPath string) *Store

NewStore new store

func (*Store) Clone

func (s *Store) Clone() map[string]Entry

Clone clone all data

func (*Store) Get

func (s *Store) Get(key string) ([]dnsmessage.Resource, bool)

Get get daya by key

func (*Store) Load

func (s *Store) Load() error

Load load from file

func (*Store) Override

func (s *Store) Override(key string, resources []dnsmessage.Resource)

Override override data

func (*Store) Remove

func (s *Store) Remove(key string, r *dnsmessage.Resource) bool

Remove remove data

func (*Store) Save

func (s *Store) Save() error

Save save to file

func (*Store) Set

func (s *Store) Set(key string, resource dnsmessage.Resource, old *dnsmessage.Resource) bool

Set data

Jump to

Keyboard shortcuts

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