generic

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Name    string
	Meta    map[string]string
	Tags    []string
	Address string
	Port    int
}

Service is a type that represents a generic service It is the canonical form for Cloud Run and Consul services

func (*Service) FromConsul

func (s *Service) FromConsul(consulService *api.AgentService) error

FromConsul is a method that converts a Consul service into a Service

func (*Service) FromRun

func (s *Service) FromRun(runService *run.Service) error

FromRun is a method that converts a Cloud Run service into a Service

func (*Service) ID

func (s *Service) ID() string

ID is a method that calculates a unique ID for a service It uses the service's Address:Port The service's Address:Port is assumed to be unique across all services

func (*Service) String

func (s *Service) String() string

String is a method that converts a Service into a string

Jump to

Keyboard shortcuts

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