types

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 6

Documentation

Index

Constants

View Source
const DefaultProtocol = "http"

Variables

This section is empty.

Functions

This section is empty.

Types

type GetAccessTokenCallback added in v2.1.0

type GetAccessTokenCallback func() (string, error)

type ServiceConfig

type ServiceConfig struct {
	// The Protocol that should be used to connect to the Configuration service. HTTP is used if not set.
	Protocol string
	// Host is the hostname or IP address of the Configuration service
	Host string
	// Port is the HTTP port of the Configuration service
	Port int
	// Type is the implementation type of the Configuration service, i.e. consul
	Type string
	// BasePath is the base path with in the Configuration service where the your service's configuration is stored
	BasePath string
	// AccessToken is the token that is used to access the service configuration
	AccessToken string
	// GetAccessToken is a callback function that retrieves a new Access Token.
	// This callback is used when a '403 Forbidden' status is received from any call to the configuration provider service.
	GetAccessToken GetAccessTokenCallback
	// Optional contains all other properties of the configuration provider might use.
	// For example, it might need the message bus connection information to publish the config changes.
	Optional map[string]any
}

ServiceConfig defines the information need to connect to the Configuration service and optionally register the service for discovery and health checks

func (*ServiceConfig) GetProtocol

func (config *ServiceConfig) GetProtocol() string

func (ServiceConfig) GetUrl

func (config ServiceConfig) GetUrl() string

func (*ServiceConfig) PopulateFromUrl

func (config *ServiceConfig) PopulateFromUrl(providerUrl string) error

Jump to

Keyboard shortcuts

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