kv

package
Version: v0.0.0-...-29f4744 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers.

As a reminder from https://golang.org/pkg/crypto/tls/#Config:

A Config structure is used to configure a TLS client or server. After one has been passed to a TLS function it must not be modified.
A Config may be reused; the tls package will also not modify it.

Index

Constants

This section is empty.

Variables

View Source
var ClientDefault = tls.Config{

	MinVersion:   tls.VersionTLS12,
	CipherSuites: clientCipherSuites,
}

ClientDefault is a secure-enough TLS configuration for the client TLS configuration.

View Source
var DefaultServerAcceptedCiphers = append(clientCipherSuites, acceptedCBCCiphers...)

DefaultServerAcceptedCiphers should be uses by code which already has a crypto/tls options struct but wants to use a commonly accepted set of TLS cipher suites, with known weak algorithms removed.

View Source
var ServerDefault = tls.Config{

	MinVersion:               tls.VersionTLS10,
	PreferServerCipherSuites: true,
	CipherSuites:             DefaultServerAcceptedCiphers,
}

ServerDefault is a secure-enough TLS configuration for the server TLS configuration.

Functions

func Client

func Client(options Options) (*tls.Config, error)

Client returns a TLS configuration meant to be used by a client.

func Init

func Init()

Init is exported

func Server

func Server(options Options) (*tls.Config, error)

Server returns a TLS configuration meant to be used by a server.

Types

type Discovery

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

Discovery is exported

func (*Discovery) Delete

func (s *Discovery) Delete(key string) error

Delete a value at "key"

func (*Discovery) DeleteTree

func (s *Discovery) DeleteTree(directory string) error

DeleteTree deletes a range of keys under a given directory

func (*Discovery) Exists

func (s *Discovery) Exists(key string) (bool, error)

Exists checks if the key exists inside the store

func (*Discovery) Get

func (s *Discovery) Get(key string) (pair *store.KVPair, err error)

Get the value at "key", returns the last modified index to use in conjunction to Atomic calls

func (*Discovery) InitKey

func (s *Discovery) InitKey() error

Initialize key

func (*Discovery) Initialize

func (s *Discovery) Initialize(uris string, heartbeat time.Duration, ttl time.Duration, clusterOpts map[string]string) error

Initialize is exported

func (*Discovery) List

func (s *Discovery) List(directory string) ([]*store.KVPair, error)

List child nodes of a given directory

func (*Discovery) Put

func (s *Discovery) Put(key string, value []byte, opts *store.WriteOptions) error

Put a value at "key"

func (*Discovery) PutTree

func (s *Discovery) PutTree(key string) error

Put a value at "key"

func (*Discovery) Register

func (s *Discovery) Register(dpid string, gateway []byte) error

Register is exported

func (*Discovery) Store

func (s *Discovery) Store() store.Store

Store returns the underlying store used by KV discovery

func (*Discovery) Watch

func (s *Discovery) Watch(path string, stopCh <-chan struct{}) (<-chan [][]byte, <-chan error)

Watch is exported

type Options

type Options struct {
	CAFile string

	// If either CertFile or KeyFile is empty, Client() will not load them
	// preventing the client from authenticating to the server.
	// However, Server() requires them and will error out if they are empty.
	CertFile string
	KeyFile  string

	// client-only option
	InsecureSkipVerify bool
	// server-only option
	ClientAuth tls.ClientAuthType
}

Options represents the information needed to create client and server TLS configurations.

Source Files

Jump to

Keyboard shortcuts

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