Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebugUserOptions ¶
type DebugUserOptions struct {
Status DebugUserStatus
Username string
Password string
}
DebugUserOptions defines the API debug user options
func (*DebugUserOptions) Prepares ¶
func (opts *DebugUserOptions) Prepares(mode Mode) error
Prepares sets defaults and validates the options
type DebugUserStatus ¶
type DebugUserStatus string
DebugUserStatus defines the debug user status option
const ( // DebugUserUnset represents the default unset option value DebugUserUnset DebugUserStatus = "" // DebugUserDisabled disables the debug user DebugUserDisabled DebugUserStatus = "disabled" // DebugUserReadOnly enables the debug user in a read-only mode DebugUserReadOnly DebugUserStatus = "read-only" // DebugUserRW enables the debug user in a read-write mode DebugUserRW DebugUserStatus = "read-write" )
type Server ¶
type Server interface {
// Launche starts the API server and unblocks as soon as the server
// is running
Launch() error
// Shutdown instructs the server to shut down gracefully and blocks until
// the server is shut down
Shutdown(context.Context) error
// AwaitShutdown blocks until the server is shut down
AwaitShutdown()
}
Server interfaces an API server implementation
func NewServer ¶
func NewServer(opts ServerOptions) (Server, error)
NewServer creates a new API server instance
type ServerOptions ¶
type ServerOptions struct {
Mode Mode
Host string
DBHost string
SessionKeyGenerator sesskeygen.SessionKeyGenerator
PasswordHasher passhash.PasswordHasher
DebugUser DebugUserOptions
Transport []transport.Server
ErrorLog *log.Logger
}
ServerOptions defines the API server options
func (*ServerOptions) Prepare ¶
func (opts *ServerOptions) Prepare() error
Prepare sets defaults and validates the options
Source Files
¶
Click to show internal directories.
Click to hide internal directories.