bootstrap

package
v0.0.0-...-110085e Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2016 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Copyright 2016 The Rook Authors. All rights reserved.

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 2016 The Rook Authors. All rights reserved.

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 2016 The Rook Authors. All rights reserved.

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 2016 The Rook Authors. All rights reserved.

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 2016 The Rook Authors. All rights reserved.

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

View Source
const (
	// DefaultClientPort is the default port for listening to client traffic
	DefaultClientPort = 53379
	// DefaultPeerPort is the default port for listening to peer traffic
	DefaultPeerPort = 53380
	// DefaultClientTimeout is the default timeout for etcd client
	DefaultClientTimeout = 5 * time.Second
)

Variables

This section is empty.

Functions

func GetCurrentNodesFromDiscovery

func GetCurrentNodesFromDiscovery(token string) ([]string, error)

func GetEtcdClients

func GetEtcdClients(configDir, token, ipAddr, nodeID string) ([]string, error)

GetEtcdClients bootstraps an embedded etcd instance and returns a list of current etcd cluster's client URLs. (entrypoint, when it's used as a library)

Types

type Config

type Config struct {
	InstanceName        string
	ListenPeerURLs      []url.URL
	ListenClientURLs    []url.URL
	AdvertisePeerURLs   []url.URL
	AdvertiseClientURLs []url.URL
	DataDir             string
	URLsMap             types.URLsMap
}

Config holds the configuration of elastic etcd.

func CopyConfig

func CopyConfig(conf *Config) Config

CopyConfig returns a copy of given etcd config

func GenerateConfigFromExistingCluster

func GenerateConfigFromExistingCluster(Context EtcdMgrContext, configDir, ipAddr, nodeID string) (*Config, error)

GenerateConfigFromExistingCluster automatically generates a config for joining an existing cluster

type Context

type Context struct {
	ClusterToken string
}

func (*Context) Client

func (e *Context) Client(initialNodes []string) (client.Client, error)

func (*Context) KeysAPI

func (e *Context) KeysAPI() (client.KeysAPI, error)

func (*Context) Members

func (e *Context) Members() ([]string, types.URLsMap, error)

func (*Context) MembersAPI

func (e *Context) MembersAPI() (client.MembersAPI, error)

MembersAPI returns an instance of MembersAPI for the current etcd cluster

type EmbeddedEtcd

type EmbeddedEtcd struct {
	Server *etcdserver.EtcdServer
	// contains filtered or unexported fields
}

EmbeddedEtcd represents an instance of etcd server.

func (*EmbeddedEtcd) Destroy

func (ee *EmbeddedEtcd) Destroy(conf *Config) error

Destroy wipes out the current instance of etcd and makes the necessary cleanup.

func (*EmbeddedEtcd) InitializeListeners

func (ee *EmbeddedEtcd) InitializeListeners() error

type EmbeddedEtcdFactory

type EmbeddedEtcdFactory struct {
}

func (*EmbeddedEtcdFactory) NewEmbeddedEtcd

func (e *EmbeddedEtcdFactory) NewEmbeddedEtcd(token string, conf *Config, newCluster bool) (*EmbeddedEtcd, error)

NewEmbeddedEtcd creates a new inproc instance of etcd.

type EtcdFactory

type EtcdFactory interface {
	NewEmbeddedEtcd(token string, conf *Config, newCluster bool) (*EmbeddedEtcd, error)
}

type EtcdMgrContext

type EtcdMgrContext interface {
	Client(initialNodes []string) (client.Client, error)
	MembersAPI() (client.MembersAPI, error)
	KeysAPI() (client.KeysAPI, error)
	Members() ([]string, types.URLsMap, error)
}

type Machine

type Machine struct {
	client.Member
}

Jump to

Keyboard shortcuts

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