types

package
v3.0.0-dev.6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The Protocol that should be used to connect to the registry service. HTTP is used if not set.
	Protocol string
	// Host is the hostname or IP address of the registry service
	Host string
	// Port is the HTTP port of the registry service
	Port int
	// Type is the implementation type of the registry service, i.e. consul
	Type string
	// ServiceKey is the key identifying the service for Registration and building the services base configuration path.
	ServiceKey string
	// ServiceHost is the hostname or IP address of the current running service using this module. May be left empty if not using registration
	ServiceHost string
	// ServicePort is the HTTP port of the current running service using this module. May be left unset if not using registration
	ServicePort int
	// The ServiceProtocol that should be used to call the current running service using this module. May be left empty if not using registration
	ServiceProtocol string
	// Health check callback route for the current running service using this module. May be left empty if not using registration
	CheckRoute string
	// Health check callback interval. May be left empty if not using registration
	CheckInterval string
	// AccessToken is the optional ACL token for accessing the Registry. This token is only needed when the Registry has
	// been secured with a ACL
	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
}

Config defines the information need to connect to the registry service and optionally register the service for discovery and health checks

func (Config) GetExpandedRoute

func (config Config) GetExpandedRoute(route string) string

func (Config) GetHealthCheckUrl

func (config Config) GetHealthCheckUrl() string

func (Config) GetRegistryProtocol

func (config Config) GetRegistryProtocol() string

func (Config) GetRegistryUrl

func (config Config) GetRegistryUrl() string

func (Config) GetServiceProtocol

func (config Config) GetServiceProtocol() string

type GetAccessTokenCallback

type GetAccessTokenCallback func() (string, error)

type ServiceEndpoint

type ServiceEndpoint struct {
	ServiceId string
	Host      string
	Port      int
}

ServiceEndpoint defines the service information returned by GetServiceEndpoint() need to connect to the target service

Jump to

Keyboard shortcuts

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