client

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Config of the client
	Config() *Config

	// FetchFile queries the remote configuration service and returns the resulting file
	// it is possible to pass error handler function as second parameter
	FetchFile(source string, errorHandler func([]byte, error) []byte) []byte

	// FetchFileE queries the remote configuration service and returns the resulting file
	FetchFileE(source string) ([]byte, error)

	// FetchAs queries the remote configuration service and returns the result in specified format
	FetchAs(extension Extension) (string, error)

	// FetchAsJSON queries the remote configuration service and returns the result as a JSON string
	FetchAsJSON() (string, error)

	// FetchAsYAML queries the remote configuration service and returns the result as a YAML string
	FetchAsYAML() (string, error)

	// FetchAsProperties queries the remote configuration service and returns the result as a Properties string
	FetchAsProperties() (string, error)

	// Encrypt encrypts the value server side and returns result
	Encrypt(value string) (string, error)

	// Decrypt decrypts the value server side and returns result
	Decrypt(value string) (string, error)
}

Client Spring Cloud Config Client.

func NewClient

func NewClient(c Config) Client

NewClient creates instance of the Client.

type Config

type Config struct {
	URI         string
	Profile     string
	Application string
	Label       string
}

Config needed to fetch a remote configuration.

type Extension

type Extension string

Extension format of downloaded config.

func ParseExtension

func ParseExtension(str string) (Extension, error)

ParseExtension parse string into Extension type.

type HTTPError added in v0.0.9

type HTTPError struct {
	*resty.Response
}

HTTPError used for wrapping an exception returned from Client.

func (HTTPError) Error added in v0.0.9

func (e HTTPError) Error() string

Error is an implementation of error type interface method.

Jump to

Keyboard shortcuts

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