Documentation
¶
Overview ¶
Package service makes every request the Go doit sends to doit's service. It is written by hand against the wire contract that the Python client keeps.
A route's call is a method on Client that names its path and the Go type of its answer. The verb needs every field that type declares without omitempty. A Go release can reach a desk before the cluster rolls the matching service. So Get refuses an answer that lacks such a field, rather than drawing it empty, and names the field and the service's version.
Index ¶
Constants ¶
const NoAnswerExit = 4
NoAnswerExit is what a command exits with where no answer came, the one failure that the same command run later can outlast.
const Prefix = "/api/v1"
Prefix is where every route sits, the OpenAPI document among them. deploy/api.yaml names the paths the cluster routes to the service.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is one authenticated client of the service at base.
func New ¶
func New(base string, source oauth2.TokenSource, chosenBy, repair string) *Client
New is a client of the service at base, sending source's token. chosenBy says where base came from, and repair what fixes a refused token.
type MissingField ¶
type MissingField struct {
Where string
Route string
Field string
Version string
// VersionUnread is why the service's version could not be read, where it could not.
VersionUnread error
}
MissingField is an answer that lacks a field which the verb needs.
func (*MissingField) Error ¶
func (m *MissingField) Error() string