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 ¶
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 GetEtcdClients ¶
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 ¶
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) 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)
}