client

package
v0.0.0-...-678bb0e Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package client implements a config client backend for a configuration client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Provider Provider
}

Backend returns a backend.B implementation that falls through to the supplied configuration service client's config.Interface, supplied by the Provider.

url is the base URL to the configuration service, e.g., https://example.appspot.com.

func (*Backend) ConfigSetURL

func (be *Backend) ConfigSetURL(c context.Context, configSet string, p backend.Params) (url.URL, error)

ConfigSetURL implements backend.B.

func (*Backend) Get

func (be *Backend) Get(c context.Context, configSet, path string, p backend.Params) (*backend.Item, error)

Get implements backend.B.

func (*Backend) GetAll

func (be *Backend) GetAll(c context.Context, t backend.GetAllTarget, path string, p backend.Params) (
	[]*backend.Item, error)

GetAll implements backend.B.

func (*Backend) GetConfigInterface

func (be *Backend) GetConfigInterface(c context.Context, a backend.Authority) config.Interface

func (*Backend) ServiceURL

func (be *Backend) ServiceURL(c context.Context) url.URL

ServiceURL implements backend.B.

type Provider

type Provider interface {
	GetServiceURL() url.URL
	GetConfigClient(context.Context, backend.Authority) config.Interface
}

Provider returns a config.Interface for the supplied parameters.

type RemoteProvider

type RemoteProvider struct {
	// Host is the base host name of the configuration service, e.g.,
	// "example.appspot.com".
	Host string
	// Insecure is true if the connection should use HTTP instead of HTTPS.
	Insecure bool
	// contains filtered or unexported fields
}

RemoteProvider is a Provider implementation that binds to a remote configuration service.

func (*RemoteProvider) GetConfigClient

func (p *RemoteProvider) GetConfigClient(c context.Context, a backend.Authority) config.Interface

GetConfigClient implements Provider.

func (*RemoteProvider) GetServiceURL

func (p *RemoteProvider) GetServiceURL() url.URL

GetServiceURL implements Provider.

Jump to

Keyboard shortcuts

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