app

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaContentType = profiles.SchemaContentType

SchemaContentType is the media type a client sends in Accept to request a resource's JSON Schema instead of its data, served on the same endpoint.

Variables

This section is empty.

Functions

func DecodeBody

func DecodeBody(ctx context.Context, fallback map[string]any) (map[string]any, error)

func NormalizeConfigDir

func NormalizeConfigDir(value string) string

func ResolveConfigDir

func ResolveConfigDir(args []string) string

func ResolveProfilesDir

func ResolveProfilesDir(args []string) string

func WriteSchemas

func WriteSchemas(dir string) error

WriteSchemas renders each schema to <dir>/<file>, creating the directory.

Types

type App

type App struct {
	Runtime     *Runtime
	Connections *connections.Service
	Profiles    *profiles.Service
	Sessions    *sessions.Runner
	// contains filtered or unexported fields
}

func New

func New(options Options) (*App, error)

func (*App) RegisterEntities

func (a *App) RegisterEntities(ctx context.Context) error

func (*App) RunTop

func (a *App) RunTop(ctx context.Context, name string, options sessions.TopOptions) error

func (*App) RunTrace

func (a *App) RunTrace(ctx context.Context, name string, options sessions.TraceOptions) error

func (*App) Serve

func (a *App) Serve(parent context.Context, root *cobra.Command, configDir string, options ServeOptions) error

type Options

type Options struct {
	Args   []string
	Stdout io.Writer
	Stderr io.Writer
}

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(ctx dbcontext.Context, store profiles.Store) (*Runtime, error)

func (*Runtime) Context

func (r *Runtime) Context() dbcontext.Context

func (*Runtime) Database

func (r *Runtime) Database() (*gorm.DB, error)

func (*Runtime) ProfileStore

func (r *Runtime) ProfileStore() (profiles.Store, error)

func (*Runtime) SetContext

func (r *Runtime) SetContext(ctx dbcontext.Context) error

func (*Runtime) SetDatabase

func (r *Runtime) SetDatabase(db *gorm.DB) error

func (*Runtime) SetProfileStore

func (r *Runtime) SetProfileStore(store profiles.Store) error

type ServeOptions

type ServeOptions struct {
	Host               string
	Port               int
	DataDir            string
	Dev                bool
	MaxSessions        int
	MaxSessionDuration time.Duration
	SessionRetention   time.Duration
}

func DefaultServeOptions

func DefaultServeOptions() ServeOptions

Jump to

Keyboard shortcuts

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