Documentation
¶
Index ¶
- func ScanInvalid(data []byte, atEOF bool) (advance int, token []byte, err error)
- type AuthorizeHandler
- type AuthorizeHandlerFunc
- type Client
- func (m *Client) Authorize(input driver.AuthorizeInput) (f driver.AuthorizeOutput)
- func (m *Client) FieldResolve(input driver.FieldResolveInput) (f driver.FieldResolveOutput)
- func (m *Client) InterfaceResolveType(input driver.InterfaceResolveTypeInput) (i driver.InterfaceResolveTypeOutput)
- func (m *Client) ScalarParse(input driver.ScalarParseInput) (s driver.ScalarParseOutput)
- func (m *Client) ScalarSerialize(input driver.ScalarSerializeInput) (s driver.ScalarSerializeOutput)
- func (m *Client) SetSecrets(input driver.SetSecretsInput) driver.SetSecretsOutput
- func (m *Client) Stderr(ctx context.Context, name string) error
- func (m *Client) Stdout(ctx context.Context, name string) error
- func (m *Client) Stream(input driver.StreamInput) (s driver.StreamOutput)
- func (m *Client) SubscriptionConnection(input driver.SubscriptionConnectionInput) (f driver.SubscriptionConnectionOutput)
- func (m *Client) SubscriptionListen(input driver.SubscriptionListenInput) (out driver.SubscriptionListenOutput)
- func (m *Client) UnionResolveType(input driver.UnionResolveTypeInput) (f driver.UnionResolveTypeOutput)
- type FieldResolveHandler
- type FieldResolveHandlerFunc
- type InterfaceResolveTypeHandler
- type InterfaceResolveTypeHandlerFunc
- type PipeStderr
- type PipeStdout
- type ScalarParseHandler
- type ScalarParseHandlerFunc
- type ScalarSerializeHandler
- type ScalarSerializeHandlerFunc
- type Server
- func (m *Server) Authorize(ctx context.Context, input *protoMessages.AuthorizeRequest) (f *protoMessages.AuthorizeResponse, _ error)
- func (m *Server) FieldResolve(ctx context.Context, input *protoMessages.FieldResolveRequest) (f *protoMessages.FieldResolveResponse, _ error)
- func (m *Server) InterfaceResolveType(ctx context.Context, input *protoMessages.InterfaceResolveTypeRequest) (f *protoMessages.InterfaceResolveTypeResponse, _ error)
- func (m *Server) ScalarParse(ctx context.Context, input *protoMessages.ScalarParseRequest) (s *protoMessages.ScalarParseResponse, _ error)
- func (m *Server) ScalarSerialize(ctx context.Context, input *protoMessages.ScalarSerializeRequest) (s *protoMessages.ScalarSerializeResponse, _ error)
- func (m *Server) SetSecrets(ctx context.Context, input *protoMessages.SetSecretsRequest) (o *protoMessages.SetSecretsResponse, _ error)
- func (m *Server) Stderr(s *protoMessages.ByteStreamRequest, ss protoDriverService.Driver_StderrServer) error
- func (m *Server) Stdout(s *protoMessages.ByteStreamRequest, ss protoDriverService.Driver_StdoutServer) error
- func (m *Server) Stream(s *protoMessages.StreamRequest, ss protoDriverService.Driver_StreamServer) error
- func (m *Server) SubscriptionConnection(ctx context.Context, input *protoMessages.SubscriptionConnectionRequest) (s *protoMessages.SubscriptionConnectionResponse, _ error)
- func (m *Server) SubscriptionListen(req *protoMessages.SubscriptionListenRequest, ...) error
- func (m *Server) UnionResolveType(ctx context.Context, input *protoMessages.UnionResolveTypeRequest) (f *protoMessages.UnionResolveTypeResponse, _ error)
- type SetSecretsHandler
- type SetSecretsHandlerFunc
- type StderrHandler
- type StderrHandlerFunc
- type StdoutHandler
- type StdoutHandlerFunc
- type StreamHandler
- type StreamHandlerFunc
- type SubscriptionConnectionHandler
- type SubscriptionConnectionHandlerFunc
- type SubscriptionListenEmitter
- type SubscriptionListenHandler
- type UnionResolveTypeHandler
- type UnionResolveTypeHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthorizeHandler ¶
type AuthorizeHandler interface { // Handle takes AuthorizeInput as a field resolution input and returns arbitrary // user response. Handle(input driver.AuthorizeInput) (bool, error) }
AuthorizeHandler interface implemented by user to handle field resolution request.
type AuthorizeHandlerFunc ¶
type AuthorizeHandlerFunc func(input driver.AuthorizeInput) (bool, error)
AuthorizeHandlerFunc is a convienience function wrapper implementing AuthorizeHandler
func (AuthorizeHandlerFunc) Handle ¶
func (f AuthorizeHandlerFunc) Handle(input driver.AuthorizeInput) (bool, error)
Handle takes AuthorizeInput as a field resolution input and returns arbitrary
type Client ¶
type Client struct {
Client protoDriverService.DriverClient
}
Client for github.com/graphql-editor/stucco/pkg/proto
func (*Client) Authorize ¶
func (m *Client) Authorize(input driver.AuthorizeInput) (f driver.AuthorizeOutput)
Authorize marshals a field resolution request through GRPC to a function that handles an actual resolution.
func (*Client) FieldResolve ¶
func (m *Client) FieldResolve(input driver.FieldResolveInput) (f driver.FieldResolveOutput)
FieldResolve marshals a field resolution request through GRPC to a function that handles an actual resolution.
func (*Client) InterfaceResolveType ¶
func (m *Client) InterfaceResolveType(input driver.InterfaceResolveTypeInput) (i driver.InterfaceResolveTypeOutput)
InterfaceResolveType handles type resolution for interface through GRPC
func (*Client) ScalarParse ¶
func (m *Client) ScalarParse(input driver.ScalarParseInput) (s driver.ScalarParseOutput)
ScalarParse executes server side ScalarParse rpc
func (*Client) ScalarSerialize ¶
func (m *Client) ScalarSerialize(input driver.ScalarSerializeInput) (s driver.ScalarSerializeOutput)
ScalarSerialize executes server side ScalarSerialize rpc
func (*Client) SetSecrets ¶
func (m *Client) SetSecrets(input driver.SetSecretsInput) driver.SetSecretsOutput
SetSecrets sets a marshals secrets through GRPC
func (*Client) Stderr ¶
Stderr opens a byte stream between from server to client and logs results using k8s.io/klog
Checks if byte stream is valid json with property level set to warn or err and logs the contents of message property from json. Otherwise if byte stream has prefix [WARN] or [ERROR] logs the contents of stream to matching klog Severity. If not matched, logs the whole byte stream unmodified to Error severity.
func (*Client) Stdout ¶
Stdout opens a byte stream between from server to client and logs results using k8s.io/klog
Checks if byte stream is valid json with property level set to info or debug and logs the contents of message property from json. Otherwise if byte stream has prefix [INFO] or [DEBUG] logs the contents of stream to matching verbosity level without prefix. If not matched, logs the whole byte stream unmodified with debug verbosity.
Info verbosity is 3 Debug verbosity is 5
func (*Client) Stream ¶
func (m *Client) Stream(input driver.StreamInput) (s driver.StreamOutput)
Stream TODO: client side stream requests
func (*Client) SubscriptionConnection ¶
func (m *Client) SubscriptionConnection(input driver.SubscriptionConnectionInput) (f driver.SubscriptionConnectionOutput)
SubscriptionConnection marshals a field resolution request through GRPC to a function that handles an actual resolution.
func (*Client) SubscriptionListen ¶
func (m *Client) SubscriptionListen(input driver.SubscriptionListenInput) (out driver.SubscriptionListenOutput)
SubscriptionListen returns a subscription event reader.
func (*Client) UnionResolveType ¶
func (m *Client) UnionResolveType(input driver.UnionResolveTypeInput) (f driver.UnionResolveTypeOutput)
UnionResolveType Implements driver.Driver
type FieldResolveHandler ¶
type FieldResolveHandler interface { // Handle takes FieldResolveInput as a field resolution input and returns arbitrary // user response. Handle(input driver.FieldResolveInput) (interface{}, error) }
FieldResolveHandler interface implemented by user to handle field resolution request.
type FieldResolveHandlerFunc ¶
type FieldResolveHandlerFunc func(input driver.FieldResolveInput) (interface{}, error)
FieldResolveHandlerFunc is a convienience function wrapper implementing FieldResolveHandler
func (FieldResolveHandlerFunc) Handle ¶
func (f FieldResolveHandlerFunc) Handle(input driver.FieldResolveInput) (interface{}, error)
Handle takes FieldResolveInput as a field resolution input and returns arbitrary
type InterfaceResolveTypeHandler ¶
type InterfaceResolveTypeHandler interface { // Handle takes InterfaceResolveTypeInput as a type resolution input and returns // type name. Handle(driver.InterfaceResolveTypeInput) (string, error) }
InterfaceResolveTypeHandler interface implemented by user to handle interface type resolution
type InterfaceResolveTypeHandlerFunc ¶
type InterfaceResolveTypeHandlerFunc func(driver.InterfaceResolveTypeInput) (string, error)
InterfaceResolveTypeHandlerFunc is a convienience function wrapper implementing InterfaceResolveTypeHandler
func (InterfaceResolveTypeHandlerFunc) Handle ¶
func (f InterfaceResolveTypeHandlerFunc) Handle(in driver.InterfaceResolveTypeInput) (string, error)
Handle takes InterfaceResolveTypeInput as a type resolution input and returns type name.
type PipeStderr ¶
type PipeStderr struct {
// contains filtered or unexported fields
}
PipeStderr adds a hook to os.Stderr, watching all writes done to os.Stderr. Writes both written to os.Stderr and to GRPC ByteStream.
func (*PipeStderr) Close ¶
func (p *PipeStderr) Close() error
Close cleans up after a hook. It is an error to not close a hook.
func (*PipeStderr) Handle ¶
func (p *PipeStderr) Handle(req *protoMessages.ByteStreamRequest, srv protoDriverService.Driver_StderrServer) error
Handle is a blocking method that sends all Writes to os.Stderr through GRPC
func (*PipeStderr) Open ¶
func (p *PipeStderr) Open() error
Open creates a new hook on os.Stderr. Must be called before Handle.
type PipeStdout ¶
type PipeStdout struct {
// contains filtered or unexported fields
}
PipeStdout adds a hook to os.Stdout, watching all writes done to os.Stdout. Writes both written to os.Stdout and to GRPC ByteStream.
func (*PipeStdout) Close ¶
func (p *PipeStdout) Close() error
Close cleans up after a hook. It is an error to not close a hook.
func (*PipeStdout) Handle ¶
func (p *PipeStdout) Handle(req *protoMessages.ByteStreamRequest, srv protoDriverService.Driver_StdoutServer) error
Handle is a blocking method that sends all Writes to os.Stdout through GRPC
func (*PipeStdout) Open ¶
func (p *PipeStdout) Open() error
Open creates a new hook on os.Stdout. Must be called before Handle.
type ScalarParseHandler ¶
type ScalarParseHandler interface { // Handle takes ScalarParseInput as input returning arbitrary parsed value Handle(driver.ScalarParseInput) (interface{}, error) }
ScalarParseHandler interface that must be implemented by user to handle scalar parse requests
type ScalarParseHandlerFunc ¶
type ScalarParseHandlerFunc func(driver.ScalarParseInput) (interface{}, error)
ScalarParseHandlerFunc is a convienience wrapper for function implementing ScalarParseHandler
func (ScalarParseHandlerFunc) Handle ¶
func (f ScalarParseHandlerFunc) Handle(input driver.ScalarParseInput) (interface{}, error)
Handle implements ScalarParseHandler.Handle
type ScalarSerializeHandler ¶
type ScalarSerializeHandler interface { // Handle takes ScalarSerializeInput as input returning arbitrary serialized value Handle(driver.ScalarSerializeInput) (interface{}, error) }
ScalarSerializeHandler interface that must be implemented by user to handle scalar serialize requests
type ScalarSerializeHandlerFunc ¶
type ScalarSerializeHandlerFunc func(driver.ScalarSerializeInput) (interface{}, error)
ScalarSerializeHandlerFunc is a convienience wrapper for function implementing ScalarSerializeHandler
func (ScalarSerializeHandlerFunc) Handle ¶
func (f ScalarSerializeHandlerFunc) Handle(input driver.ScalarSerializeInput) (interface{}, error)
Handle implements ScalarSerializeHandler.Handle
type Server ¶
type Server struct { protoDriverService.DriverServer AuthorizeHandler AuthorizeHandler FieldResolveHandler FieldResolveHandler InterfaceResolveTypeHandler InterfaceResolveTypeHandler ScalarParseHandler ScalarParseHandler ScalarSerializeHandler ScalarSerializeHandler UnionResolveTypeHandler UnionResolveTypeHandler SetSecretsHandler SetSecretsHandler StreamHandler StreamHandler StdoutHandler StdoutHandler StderrHandler StderrHandler SubscriptionConnectionHandler SubscriptionConnectionHandler SubscriptionListenHandler SubscriptionListenHandler }
Server for github.com/graphql-editor/stucco/pkg/proto
func (*Server) Authorize ¶
func (m *Server) Authorize(ctx context.Context, input *protoMessages.AuthorizeRequest) (f *protoMessages.AuthorizeResponse, _ error)
Authorize function calls user implemented handler for field resolution
func (*Server) FieldResolve ¶
func (m *Server) FieldResolve(ctx context.Context, input *protoMessages.FieldResolveRequest) (f *protoMessages.FieldResolveResponse, _ error)
FieldResolve function calls user implemented handler for field resolution
func (*Server) InterfaceResolveType ¶
func (m *Server) InterfaceResolveType(ctx context.Context, input *protoMessages.InterfaceResolveTypeRequest) (f *protoMessages.InterfaceResolveTypeResponse, _ error)
InterfaceResolveType handles type resolution request with user defined function
func (*Server) ScalarParse ¶
func (m *Server) ScalarParse(ctx context.Context, input *protoMessages.ScalarParseRequest) (s *protoMessages.ScalarParseResponse, _ error)
ScalarParse calls user defined function for parsing a scalar.
func (*Server) ScalarSerialize ¶
func (m *Server) ScalarSerialize(ctx context.Context, input *protoMessages.ScalarSerializeRequest) (s *protoMessages.ScalarSerializeResponse, _ error)
ScalarSerialize executes user handler for scalar serialization
func (*Server) SetSecrets ¶
func (m *Server) SetSecrets(ctx context.Context, input *protoMessages.SetSecretsRequest) (o *protoMessages.SetSecretsResponse, _ error)
SetSecrets calls user SetSecrets handler
func (*Server) Stderr ¶
func (m *Server) Stderr(s *protoMessages.ByteStreamRequest, ss protoDriverService.Driver_StderrServer) error
Stderr handles a stderr bytestream request for server
func (*Server) Stdout ¶
func (m *Server) Stdout(s *protoMessages.ByteStreamRequest, ss protoDriverService.Driver_StdoutServer) error
Stdout handles a stdout bytestream request for server
func (*Server) Stream ¶
func (m *Server) Stream(s *protoMessages.StreamRequest, ss protoDriverService.Driver_StreamServer) error
Stream hands over stream request to user defined handler for stream
func (*Server) SubscriptionConnection ¶
func (m *Server) SubscriptionConnection(ctx context.Context, input *protoMessages.SubscriptionConnectionRequest) (s *protoMessages.SubscriptionConnectionResponse, _ error)
SubscriptionConnection function calls user implemented handler for subscription connection creation
func (*Server) SubscriptionListen ¶
func (m *Server) SubscriptionListen(req *protoMessages.SubscriptionListenRequest, srv protoDriverService.Driver_SubscriptionListenServer) error
SubscriptionListen implements protoMessages.DriverServer
func (*Server) UnionResolveType ¶
func (m *Server) UnionResolveType(ctx context.Context, input *protoMessages.UnionResolveTypeRequest) (f *protoMessages.UnionResolveTypeResponse, _ error)
UnionResolveType executes union type resolution request agains user defined function
type SetSecretsHandler ¶
type SetSecretsHandler interface { // Handle takes SetSecretsHandler as an input and should set a secrets on a server state. It should return nil if there was no error. Handle(input driver.SetSecretsInput) error }
SetSecretsHandler interface implemented by user to handle secrets input from client.
type SetSecretsHandlerFunc ¶
type SetSecretsHandlerFunc func(input driver.SetSecretsInput) error
SetSecretsHandlerFunc is a convienience wrapper around function to implement SetSecretsHandler
func (SetSecretsHandlerFunc) Handle ¶
func (s SetSecretsHandlerFunc) Handle(input driver.SetSecretsInput) error
Handle takes SetSecretsInput as an input, sets a secrets state, and returns a nil if there was no error
type StderrHandler ¶
type StderrHandler interface {
Handle(*protoMessages.ByteStreamRequest, protoDriverService.Driver_StderrServer) error
}
StderrHandler interface that must be implemented by user for handling stderr bytestream requests by server.
type StderrHandlerFunc ¶
type StderrHandlerFunc func(*protoMessages.ByteStreamRequest, protoDriverService.Driver_StderrServer) error
StderrHandlerFunc is a type of function that must be implemented in server implementation to handle ByteStreamRequest for stderr.
func (StderrHandlerFunc) Handle ¶
func (f StderrHandlerFunc) Handle(p *protoMessages.ByteStreamRequest, d protoDriverService.Driver_StderrServer) error
Handle for implementing StderrHandler interface
type StdoutHandler ¶
type StdoutHandler interface {
Handle(*protoMessages.ByteStreamRequest, protoDriverService.Driver_StdoutServer) error
}
StdoutHandler interface that must be implemented by user for handling stdout bytestream requests by server.
type StdoutHandlerFunc ¶
type StdoutHandlerFunc func(*protoMessages.ByteStreamRequest, protoDriverService.Driver_StdoutServer) error
StdoutHandlerFunc is a type of function that must be implemented in server implementation to handle ByteStreamRequest for stdout.
func (StdoutHandlerFunc) Handle ¶
func (f StdoutHandlerFunc) Handle(p *protoMessages.ByteStreamRequest, d protoDriverService.Driver_StdoutServer) error
Handle for implementing StdoutHandler interface
type StreamHandler ¶
type StreamHandler interface { // Handle handles subscription streaming requests Handle(*protoMessages.StreamRequest, protoDriverService.Driver_StreamServer) error }
StreamHandler interface must be implemented by user to handle stream requests from subscriptions
type StreamHandlerFunc ¶
type StreamHandlerFunc func(*protoMessages.StreamRequest, protoDriverService.Driver_StreamServer) error
StreamHandlerFunc is a convienience wrapper implementing StreamHandler interface
func (StreamHandlerFunc) Handle ¶
func (f StreamHandlerFunc) Handle(s *protoMessages.StreamRequest, ss protoDriverService.Driver_StreamServer) error
Handle implements StreamHandler.Handle method
type SubscriptionConnectionHandler ¶
type SubscriptionConnectionHandler interface { // Handle takes SubscriptionConnectionInput as a field resolution input and returns // arbitrary user response. Handle(input driver.SubscriptionConnectionInput) (interface{}, error) }
SubscriptionConnectionHandler interface implemented by user to handle subscription connection creation
type SubscriptionConnectionHandlerFunc ¶
type SubscriptionConnectionHandlerFunc func(input driver.SubscriptionConnectionInput) (interface{}, error)
SubscriptionConnectionHandlerFunc is a convienience function wrapper implementing SubscriptionConnectionHandler
func (SubscriptionConnectionHandlerFunc) Handle ¶
func (f SubscriptionConnectionHandlerFunc) Handle(input driver.SubscriptionConnectionInput) (interface{}, error)
Handle takes SubscriptionConnectionInput as a field resolution input and returns arbitrary
type SubscriptionListenEmitter ¶
type SubscriptionListenEmitter interface { // Emit new subscription event Emit() error // Close emitter Close() error }
SubscriptionListenEmitter is returned to user to be called each time new subscription should be triggered.
type SubscriptionListenHandler ¶
type SubscriptionListenHandler interface {
Handle(driver.SubscriptionListenInput, SubscriptionListenEmitter) error
}
SubscriptionListenHandler interface that must be implemented by user for handling subscription listen handler.
type UnionResolveTypeHandler ¶
type UnionResolveTypeHandler interface { // Handle takes UnionResolveTypeInput as a type resolution input and returns // type name. Handle(driver.UnionResolveTypeInput) (string, error) }
UnionResolveTypeHandler union implemented by user to handle union type resolution
type UnionResolveTypeHandlerFunc ¶
type UnionResolveTypeHandlerFunc func(driver.UnionResolveTypeInput) (string, error)
UnionResolveTypeHandlerFunc is a convienience function wrapper implementing UnionResolveTypeHandler
func (UnionResolveTypeHandlerFunc) Handle ¶
func (f UnionResolveTypeHandlerFunc) Handle(in driver.UnionResolveTypeInput) (string, error)
Handle takes UnionResolveTypeInput as a type resolution input and returns type name.