nameresolution

package
v0.0.0-...-ebb33e4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

Name resolution

Name resolvers provide a common way to interact with different name resolvers, which are used to return the address or IP of other services your applications may connect to.

Implementing a new Name Resolver

A compliant name resolver needs to implement the Resolver inteface included in the nameresolution.go file.

Documentation

Index

Constants

View Source
const (
	// HostAddress is the address of the instance.
	HostAddress string = "HOST_ADDRESS"
	// DaprHTTPPort is the dapr api http port.
	DaprHTTPPort string = "DAPR_HTTP_PORT"
	// DaprPort is the dapr internal grpc port (sidecar to sidecar).
	DaprPort string = "DAPR_PORT"
	// AppPort is the port of the application, http/grpc depending on mode.
	AppPort string = "APP_PORT"
	// AppID is the ID of the application.
	AppID string = "APP_ID"
)
View Source
const DefaultNamespace = "default"

DefaultNamespace is the default kubernetes namespace.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	metadata.Base `json:",inline"`
	Configuration interface{}
}

Metadata contains a name resolution specific set of metadata properties.

type ResolveRequest

type ResolveRequest struct {
	ID        string
	Namespace string
	Port      int
	Data      map[string]string
}

ResolveRequest represents service discovery resolver request.

func NewResolveRequest

func NewResolveRequest() *ResolveRequest

NewResolveRequest creates ResolveRequest with the default namespace.

type Resolver

type Resolver interface {
	// Init initializes name resolver.
	Init(metadata Metadata) error
	// ResolveID resolves name to address.
	ResolveID(req ResolveRequest) (string, error)
}

Resolver is the interface of name resolver.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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