Documentation ¶
Overview ¶
Package auth provides a client to call the service backends based on the type of server specified in the config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadServerConfigs ¶
func LoadServerConfigs(sl []*httppb.ServerDefinition) error
LoadServerConfigs loads the server config
func NewGRPCConnection ¶
NewGRPCConnection returns a connection to a gRPC server using Google default credentials.
Types ¶
type Client ¶
type Client interface {
ExecuteRequest(ctx context.Context, req *http.Request, name string, failOnNotFound bool) (*json.RawMessage, error)
}
Client is a generic interface for communicating with the server.
type GCPClient ¶
type GCPClient struct {
// contains filtered or unexported fields
}
GCPClient is used to call a service hosted on GCP.
func (*GCPClient) ExecuteRequest ¶
func (sc *GCPClient) ExecuteRequest(ctx context.Context, req *http.Request, name string, failOnNotFound bool) (*json.RawMessage, error)
ExecuteRequest executes an http request (req). If the request fails, it is logged with the parameter name. Upon receiving a 404, it returns an error or empty JSON object depending on the failOnNotFound flag.
Click to show internal directories.
Click to hide internal directories.