data

package
v0.0.0-...-af321b4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bolt

type Bolt struct {
	L hclog.Logger
	// contains filtered or unexported fields
}

func NewBolt

func NewBolt(path string) (*Bolt, error)

func (*Bolt) AddAccount

func (b *Bolt) AddAccount(id, target string) error
func (b *Bolt) AddLabelLink(account string, source, target []string) error

func (*Bolt) AddRoute

func (b *Bolt) AddRoute(target, labelKey string) error

func (*Bolt) AddService

func (b *Bolt) AddService(accId, labelKey, serviceId, serviceType string) error

func (*Bolt) CertStorage

func (b *Bolt) CertStorage() *CertStorage

func (*Bolt) CheckAccount

func (b *Bolt) CheckAccount(id string) bool

func (*Bolt) CreateDefaultRoute

func (b *Bolt) CreateDefaultRoute(accId, labelKey string) (bool, error)

func (*Bolt) Empty

func (b *Bolt) Empty() bool
func (b *Bolt) FindLabelLink(source []string) (string, []string, error)

func (*Bolt) GetConfig

func (b *Bolt) GetConfig(key string) ([]byte, error)

func (*Bolt) HandlingHostname

func (b *Bolt) HandlingHostname(name string) bool

func (*Bolt) KnownTarget

func (b *Bolt) KnownTarget(name string) bool

func (*Bolt) LabelsForTarget

func (b *Bolt) LabelsForTarget(target string) (string, string, error)

func (*Bolt) LookupService

func (b *Bolt) LookupService(accId, labelKey string) (string, string, error)

func (*Bolt) SetConfig

func (b *Bolt) SetConfig(key string, val []byte) error

type CertStorage

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

func (*CertStorage) Delete

func (c *CertStorage) Delete(key string) error

Delete deletes key.

func (*CertStorage) Exists

func (c *CertStorage) Exists(key string) bool

Exists returns true if the key exists and there was no error checking.

func (*CertStorage) List

func (c *CertStorage) List(prefix string, recursive bool) ([]string, error)

List returns all keys that match prefix. If recursive is true, non-terminal keys will be enumerated (i.e. "directories" should be walked); otherwise, only keys prefixed exactly by prefix will be listed.

func (*CertStorage) Load

func (c *CertStorage) Load(key string) ([]byte, error)

Load retrieves the value at key.

func (*CertStorage) Lock

func (c *CertStorage) Lock(key string) error

Lock acquires the lock for key, blocking until the lock can be obtained or an error is returned. Note that, even after acquiring a lock, an idempotent operation may have already been performed by another process that acquired the lock before - so always check to make sure idempotent operations still need to be performed after acquiring the lock.

The actual implementation of obtaining of a lock must be an atomic operation so that multiple Lock calls at the same time always results in only one caller receiving the lock at any given time.

To prevent deadlocks, all implementations (where this concern is relevant) should put a reasonable expiration on the lock in case Unlock is unable to be called due to some sort of network failure or system crash.

func (*CertStorage) Stat

func (c *CertStorage) Stat(key string) (certmagic.KeyInfo, error)

Stat returns information about key.

func (*CertStorage) Store

func (c *CertStorage) Store(key string, value []byte) error

Store puts value at key.

func (*CertStorage) Unlock

func (c *CertStorage) Unlock(key string) error

Unlock releases the lock for key. This method must ONLY be called after a successful call to Lock, and only after the critical section is finished, even if it errored or timed out. Unlock cleans up any resources allocated during Lock.

type Memory

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

func (*Memory) Get

func (m *Memory) Get(path string) (interface{}, error)

func (*Memory) Set

func (m *Memory) Set(path string, data interface{}) error

Jump to

Keyboard shortcuts

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