Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// SignIn signs the client into a user
SignIn(email, password string) (*gqlmod.Session, error)
// SignInDebug signs the client into a debug user
SignInDebug(username, password string) error
// Auth authenticates the client by a user session key
Auth(sessionKey string) (*gqlmod.Session, error)
// Query performs an API query
Query(query string, result interface{}) error
// QueryVar performs a parameterized API query
QueryVar(
query string,
vars map[string]interface{},
result interface{},
) error
}
Client defines the interface of the transport layer implementation. Run and Init are not intended to be thread-safe and shall only be used by a single goroutine!
type OnDebugAuth ¶
OnDebugAuth defines the debug authentication callback function
type OnDebugSess ¶
OnDebugSess defines the debug session creation callback function
type OnGraphQuery ¶
OnGraphQuery defines the graph query callback function
type Server ¶
type Server interface {
// Init initializes the server transport implementation.
// The provided callbacks must be registered and invoked accordingly
Init(
onGraphQuery OnGraphQuery,
onAuth OnAuth,
onDebugAuth OnDebugAuth,
onDebugSess OnDebugSess,
debugLog *log.Logger,
errorLog *log.Logger,
) error
// Run starts serving. Blocks until the underlying server is shut down
Run() error
// Shutdown instructs the underlying server to shut down and blocks until
// it is
Shutdown(ctx context.Context) error
}
Server defines the interface of the server transport layer implementation. Run and Init are not intended to be thread-safe and shall only be used by a single goroutine!
Click to show internal directories.
Click to hide internal directories.