service

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	ID   string
	Name string
	// Endpoint represents the IP address of this program is running
	Endpoint string
	Weight   int
	Port     int
}

Service represents a service

func Get

func Get(name string, tags ...Tag) (*Service, error)

Get will return the best service based on the name and tag If the tag provides more than one, it will only pick the first one If the tag does not provide, the service will be picked based on the current environment(prefix of configs)

func (Service) String

func (s Service) String() string

String to string for connection with POD IP:Port

func (Service) Target

func (s Service) Target() string

Target returns a string that should be used in TKE environment only since we can use DNS feature to find out the service IP to viste in case of the changes of POD IP

type Tag

type Tag string

func (Tag) String

func (t Tag) String() string

Jump to

Keyboard shortcuts

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