api

package
v0.28.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseUintList added in v0.26.0

func ParseUintList(values []string) []uint

ParseUintList parses repeated and comma-separated query parameter values, returning only valid, positive uint values.

Types

type BodyOptions added in v0.5.0

type BodyOptions struct {
	// MaxBytes caps the body, applied to the compressed and decoded streams alike.
	MaxBytes int64
}

type Context

type Context struct {
	http.ResponseWriter
	*http.Request
	Storage       storage.Client
	GatewayClient *gclient.Client
	User          user.Info
	APIBaseURL    string

	// LocalK8sClient is a kclient for the local Kubernetes cluster — the
	// cluster the obot pod runs in, where source Secrets for
	// secretBindings live. It reads from the local router's cache. Nil on
	// the docker backend.
	LocalK8sClient kclient.Client

	// ObotNamespace is the Kubernetes namespace in which the obot server
	// runs; mcp.MergeBoundCreds reads source Secrets from here. Empty
	// when LocalK8sClient is nil.
	ObotNamespace string
}

func (*Context) Accepts

func (r *Context) Accepts(contentType string) bool

func (*Context) AuthProviderNameAndNamespace added in v0.5.0

func (r *Context) AuthProviderNameAndNamespace() (string, string)

func (*Context) AuthProviderUserID added in v0.11.0

func (r *Context) AuthProviderUserID() string

func (*Context) Body

func (r *Context) Body(opts ...BodyOptions) (_ []byte, err error)

func (*Context) Create

func (r *Context) Create(obj kclient.Object) error

func (*Context) Delete

func (r *Context) Delete(obj kclient.Object) error

func (*Context) Flush

func (r *Context) Flush()

func (*Context) Get

func (r *Context) Get(obj kclient.Object, name string) error

func (*Context) IsStreamRequested

func (r *Context) IsStreamRequested() bool

func (*Context) List

func (r *Context) List(obj kclient.ObjectList, opts ...kclient.ListOption) error

func (*Context) Namespace

func (r *Context) Namespace() string

func (*Context) Read

func (r *Context) Read(obj any) error

func (*Context) Update

func (r *Context) Update(obj kclient.Object) error

func (*Context) UserID

func (r *Context) UserID() uint

func (*Context) UserIsAdmin

func (r *Context) UserIsAdmin() bool

func (*Context) UserIsAuditor added in v0.12.0

func (r *Context) UserIsAuditor() bool

func (*Context) UserIsAuthenticated

func (r *Context) UserIsAuthenticated() bool

func (*Context) UserIsBootstrap added in v0.28.2

func (r *Context) UserIsBootstrap() bool

UserIsBootstrap reports whether the caller signed in with the bootstrap token. The bootstrap authenticator is the only one that sets the auth provider name "bootstrap" without a namespace; every real auth provider sets both. The username is deliberately not used: any user can rename themself to "bootstrap", and an identity provider can supply that name at first sign-in.

func (*Context) UserIsOwner added in v0.12.0

func (r *Context) UserIsOwner() bool

func (*Context) UserIsPowerUser added in v0.12.0

func (r *Context) UserIsPowerUser() bool

func (*Context) UserIsPowerUserPlus added in v0.23.0

func (r *Context) UserIsPowerUserPlus() bool

func (*Context) UserTimezone added in v0.5.0

func (r *Context) UserTimezone() string

func (*Context) Write

func (r *Context) Write(obj any) error

func (*Context) WriteCode added in v0.15.0

func (r *Context) WriteCode(obj any, code int) error

func (*Context) WriteCreated

func (r *Context) WriteCreated(obj any) error

type HandlerFunc

type HandlerFunc func(Context) error

type Middleware

type Middleware func(HandlerFunc) HandlerFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL