Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶ added in v1.5.6
type Auth interface { // Authenticate attempts to identify and return the user associated with // an incoming HTTP request, typically by inspecting headers or tokens. Authenticate(*http.Request) (*authschema.User, error) // Authorize checks if a given user has the necessary permissions (scopes) // to perform an action. Authorize(context.Context, *authschema.User, ...string) error }
Auth defines methods for authenticating users based on HTTP requests and authorizing them based on required scopes.
type Cmd ¶ added in v1.5.6
type Cmd interface { // Run the command Run() error // Return the context Context() context.Context // Return the debug mode GetDebug() DebugLevel // Return the endpoint GetEndpoint(paths ...string) (*url.URL, error) // Return the HTTP client options GetClientOpts() []client.ClientOpt }
Cmd represents the command line interface context
type HTTPMiddleware ¶ added in v1.5.0
type HTTPMiddleware interface { // Return a http handler with middleware as the parent handler HandleFunc(http.HandlerFunc) http.HandlerFunc }
type HTTPRouter ¶ added in v1.5.0
type LDAP ¶ added in v1.5.13
type LDAP interface { // Introspection ListObjectClasses(context.Context) ([]*ldapschema.ObjectClass, error) // Return all classes ListAttributeTypes(context.Context) ([]*ldapschema.AttributeType, error) // Return all attributes // Objects List(context.Context, ldapschema.ObjectListRequest) (*ldapschema.ObjectList, error) // List all objects in the directory Get(context.Context, string) (*ldapschema.Object, error) // Get an object Create(context.Context, string, url.Values) (*ldapschema.Object, error) // Create a new object with attributes Update(context.Context, string, url.Values) (*ldapschema.Object, error) // Update an object with attributes Delete(context.Context, string) (*ldapschema.Object, error) // Delete an object // Users ListUsers(context.Context, ldapschema.ObjectListRequest) (*ldapschema.ObjectList, error) // List users GetUser(context.Context, string) (*ldapschema.Object, error) // Get a user CreateUser(context.Context, string, url.Values) (*ldapschema.Object, error) // Create a user with attributes DeleteUser(context.Context, string) (*ldapschema.Object, error) // Delete a user // Groups ListGroups(context.Context, ldapschema.ObjectListRequest) (*ldapschema.ObjectList, error) // List groups GetGroup(context.Context, string) (*ldapschema.Object, error) // Get a group CreateGroup(context.Context, string, url.Values) (*ldapschema.Object, error) // Create a group with attributes DeleteGroup(context.Context, string) (*ldapschema.Object, error) // Delete a group // Auth Bind(context.Context, string, string) (*ldapschema.Object, error) // Check credentials ChangePassword(context.Context, string, string, *string) (*ldapschema.Object, error) // Change password for a user, and return the user object }
type Logger ¶
type Logger interface { HTTPMiddleware // Debug logs a debugging message. Debug(context.Context, ...any) // Debugf logs a formatted debugging message. Debugf(context.Context, string, ...any) // Print logs an informational message. Print(context.Context, ...any) // Printf logs a formatted informational message. Printf(context.Context, string, ...any) // With returns a new Logger that includes the given key-value pairs // in its structured log output. With(...any) Logger }
Logger defines methods for logging messages and structured data. It can also act as HTTP middleware for request logging.
type PGCallback ¶ added in v1.5.5
PGCallback defines the function signature for handling tasks dequeued from a PostgreSQL-backed queue.
type PGQueue ¶ added in v1.5.5
type PGQueue interface { PG // Namespace returns the namespace of the queue. Namespace() string // RegisterTicker registers a periodic task (ticker) with a callback function. // It returns the metadata of the registered ticker. RegisterTicker(context.Context, pgschema.TickerMeta, PGCallback) (*pgschema.Ticker, error) // RegisterQueue registers a task queue with a callback function. // It returns the metadata of the registered queue. RegisterQueue(context.Context, pgschema.QueueMeta, PGCallback) (*pgschema.Queue, error) // CreateTask adds a new task to a specified queue with a payload and optional delay. // It returns the metadata of the created task. CreateTask(context.Context, string, any, time.Duration) (*pgschema.Task, error) // UnmarshalPayload unmarshals a payload into a destination object. UnmarshalPayload(dest any, payload any) error }
PGQueue defines methods for interacting with a PostgreSQL-backed task queue.
type Plugin ¶
type Plugin interface { // Return the unique name for the plugin Name() string // Return a description of the plugin Description() string // Create a task from a plugin New(context.Context) (Task, error) }
Plugin represents a service
type PluginResolverFunc ¶ added in v1.5.7
Define a function for resolving plugin configuration
type Provider ¶
type Provider interface { Task // Write out the plugin configuration to a writer WriteConfig(io.Writer) error // Return the plugins registered with the provider Plugins() []Plugin // Load a plugin by name and label, and provide a resolver function Load(string, string, PluginResolverFunc) error // Return a task given a plugin label Task(context.Context, string) Task }
Provider represents a service provider
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
server
command
|
|
npm
|
|
pkg
|
|
plugin
|
|
auth
command
|
|
cert
command
|
|
helloworld
command
|
|
httprouter
command
|
|
httpserver
command
|
|
ldap
command
|
|
log
command
|
|
pg
command
|
|
pgqueue
command
|
|
pgqueue/old
command
|
Click to show internal directories.
Click to hide internal directories.