Documentation ¶
Index ¶
Constants ¶
const ( // JWTLifetime is the acceptable lifetime of an issued JWT token JWTLifetime = 30 * time.Second // JWTAlg is the signing algorithm used for signing and verification JWTAlg = "HS512" )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(token string, secure *tls.Config, resourceRoot string, enableBinaryDownload bool) (*grpc.Server, error)
New registers all servers and handlers for the RPC server
func NewExecutorClient ¶
func NewExecutorClient(ctx context.Context, addr string, opts *ClientOpts) (pb.ExecutorClient, error)
NewExecutorClient returns a client for a server that implements Executor
Types ¶
type ClientOpts ¶
ClientOpts contains options for the Converge RPC client
func (*ClientOpts) Opts ¶
func (c *ClientOpts) Opts() (out []grpc.DialOption)
Opts transforms the current config into options for grpc.DialContext
type ContextServer ¶
type ContextServer struct {
// contains filtered or unexported fields
}
ContextServer is a Server controlled by a context for stopping gracefully
func NewContextServer ¶
func NewContextServer(ctx context.Context, handler http.Handler) *ContextServer
NewContextServer constructs and returns a server. Mux has the same meaning as in the standard HTTP package (that is, if nil it will use the globally registered handlers)
func NewRESTGateway ¶
func NewRESTGateway(ctx context.Context, addr string, opts *ClientOpts) (*ContextServer, error)
NewRESTGateway constructs a REST gateway with the given options
func (*ContextServer) ListenAndServe ¶
func (s *ContextServer) ListenAndServe(addr string) error
ListenAndServe does the same thing as the net/http equivalent, except using the context.
func (*ContextServer) ListenAndServeTLS ¶
func (s *ContextServer) ListenAndServeTLS(addr, certFile, keyFile string) error
ListenAndServeTLS does the same thing as the net/http equivalent, except using the context.
type GrapherClient ¶
type GrapherClient struct {
// contains filtered or unexported fields
}
GrapherClient is a wrapper around a pb.GrapherClient
func NewGrapherClient ¶
func NewGrapherClient(ctx context.Context, addr string, opts *ClientOpts) (*GrapherClient, error)
NewGrapherClient returns a client for a server that implements Executor
func (*GrapherClient) Graph ¶
func (gc *GrapherClient) Graph(ctx context.Context, loc *pb.LoadRequest, opts ...grpc.CallOption) (*graph.Graph, error)
Graph gets the graph from the remote side
type JWTAuth ¶
type JWTAuth struct {
// contains filtered or unexported fields
}
JWTAuth does authentication between client and server
func NewJWTAuth ¶
NewJWTAuth initializes a new JWTAuth from the token
func (*JWTAuth) GetRequestMetadata ¶
GetRequestMetadata gets the current request metadata
func (*JWTAuth) RequireTransportSecurity ¶
RequireTransportSecurity indicates whether JWT requires transport security (it does not)