etcd

package
v7.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

  • Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors *
  • 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.

* Copyright 2019-2024 Open Networking Foundation (ONF) and the ONF Contributors

* 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 MKConfig

func MKConfig(ctx context.Context, configName string, clientPort, peerPort int, localPersistentStorageDir string, logLevel string) *embed.Config

* MKConfig creates an embedded Etcd config * :param configName: A name for this config * :param clientPort: The port the etcd client will connect to (do not use 2379 for unit test) * :param peerPort: The port the etcd server will listen for its peers (do not use 2380 for unit test) * :param localPersistentStorageDir: The name of a local directory which will hold the Etcd server data * :param logLevel: One of debug, info, warn, error, panic, or fatal. Default 'info'.

Types

type EtcdServer

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

EtcdServer represents an embedded Etcd server. It is used for testing only.

func StartEtcdServer

func StartEtcdServer(ctx context.Context, cfg *embed.Config) *EtcdServer

StartEtcdServer creates and starts an embedded Etcd server. A local directory to store data is created for the embedded server lifetime (for the duration of a unit test. The server runs at localhost:2379.

func (*EtcdServer) Stop

func (es *EtcdServer) Stop(ctx context.Context)

Stop closes the embedded Etcd server and removes the local data directory as well

Jump to

Keyboard shortcuts

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