etcd

package
v0.0.0-...-44c4069 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright Axis Communications AB.

For a full list of individual contributors, please see the commit history.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg config.Config, logger *logrus.Logger, treePrefix string) database.Opener

New returns a new Etcd Object/Struct.

Types

type Etcd

type Etcd struct {
	ID uuid.UUID
	// contains filtered or unexported fields
}

TODO: refactor the client so that it does not store data it fetched. However, without it implementing the database.Opener interface would be more complex (methods readByte, read).

func (Etcd) Open

func (etcd Etcd) Open(ctx context.Context, id uuid.UUID) io.ReadWriter

Open returns a copy of an Etcd client with ID and context added

func (*Etcd) Read

func (etcd *Etcd) Read(p []byte) (n int, err error)

Read reads data from etcd and returns p bytes to user

func (Etcd) Write

func (etcd Etcd) Write(p []byte) (int, error)

Write writes data to etcd

Jump to

Keyboard shortcuts

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