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 ¶
UnmarshalJSON converts b to a Service, applying the default values from DefaultService.
Click to show internal directories.
Click to hide internal directories.