svc

package
v0.0.0-...-7baeb4b Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: Apache-2.0 Imports: 6 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultService is used by UnmarshalJSON and describes the default settings.
	DefaultService = Service{Type: svctype.ServiceHTTP, NumReplicas: 1}
)
View Source
var ErrEmptyName = errors.New("services must have a name")

ErrEmptyName is returned when attempting to parse JSON without an empty name field.

Functions

This section is empty.

Types

type Service

type Service struct {
	// Name is the DNS-addressable name of the service.
	Name string `json:"name"`

	// Type describes what protocol the service supports (e.g. HTTP, gRPC).
	Type svctype.ServiceType `json:"type,omitempty"`

	// NumReplicas is the number of replicas backing this service.
	NumReplicas int32 `json:"numReplicas,omitempty"`

	// IsEntrypoint indicates that this service is an entrypoint into the service
	// graph, representing a public service.
	IsEntrypoint bool `json:"isEntrypoint,omitempty"`

	// ErrorRate is the percentage chance between 0 and 1 that this service
	// should respond with a 500 server error rather than 200 OK.
	ErrorRate pct.Percentage `json:"errorRate,omitempty"`

	// ResponseSize is the number of bytes in the response body.
	ResponseSize size.ByteSize `json:"responseSize,omitempty"`

	// Script is sequentially called each time the service is called.
	Script script.Script `json:"script,omitempty"`
}

Service describes a service in the service graph.

func (*Service) UnmarshalJSON

func (svc *Service) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON converts b to a Service, applying the default values from DefaultService.

Jump to

Keyboard shortcuts

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