client

package
v0.0.0-...-35d8de9 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 10 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) Get

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

Get implements backend.B.

func (*Backend) GetAll

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

GetAll implements backend.B.

func (*Backend) GetConfigInterface

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

GetConfigInterface implements backend.B.

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(ctx 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