server

package
v0.0.1-dev.9 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2025 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AuthorizationHeader is the header key for API key authentication.
	AuthorizationHeader = "authorization"

	// APIKeyPrefix is the prefix for API key values in the Authorization header.
	APIKeyPrefix = "Bearer "
)

Variables

This section is empty.

Functions

func SeedBuiltinNamespaces

func SeedBuiltinNamespaces(ctx context.Context, st store.Store) error

SeedBuiltinNamespaces ensures the built-in namespaces exist (idempotent).

func SeedBuiltinPolicies

func SeedBuiltinPolicies(ctx context.Context, st store.Store) error

SeedBuiltinPolicies ensures the built-in policies exist (idempotent).

Types

type APIServer

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

APIServer represents the gRPC API server for Rune.

func New

func New(opts ...Option) (*APIServer, error)

New creates a new API server with the given options.

func (*APIServer) GetStore

func (s *APIServer) GetStore() store.Store

GetStore returns the store instance.

func (*APIServer) Start

func (s *APIServer) Start() error

Start starts the API server.

func (*APIServer) Stop

func (s *APIServer) Stop() error

Stop stops the API server gracefully.

type AuthInfo

type AuthInfo struct {
	SubjectID string
}

AuthInfo holds minimal identity used by handlers for RBAC checks

type Option

type Option func(*Options)

Option is a function that configures options.

func WithAuth

func WithAuth(_ []string) Option

WithAuth enables authentication with the given API keys.

func WithDockerRunner

func WithDockerRunner(runner runner.Runner) Option

WithDockerRunner sets the Docker runner.

func WithGRPCAddr

func WithGRPCAddr(addr string) Option

WithGRPCAddr sets the gRPC address.

func WithHTTPAddr

func WithHTTPAddr(addr string) Option

WithHTTPAddr sets the HTTP address.

func WithLogger

func WithLogger(logger log.Logger) Option

WithLogger sets the logger.

func WithOrchestrator

func WithOrchestrator(orchestrator orchestrator.Orchestrator) Option

WithOrchestrator sets the orchestrator.

func WithProcessRunner

func WithProcessRunner(runner runner.Runner) Option

WithProcessRunner sets the process runner.

func WithStore

func WithStore(store store.Store) Option

WithStore sets the state store.

func WithTLS

func WithTLS(certFile, keyFile string) Option

WithTLS enables TLS with the given certificate and key files.

type Options

type Options struct {
	// Server addresses
	GRPCAddr string
	HTTPAddr string

	// TLS configuration
	EnableTLS   bool
	TLSCertFile string
	TLSKeyFile  string

	// Authentication (token-only)
	EnableAuth bool

	// Logging
	Logger log.Logger

	// State store
	Store store.Store

	// Runner manager
	RunnerManager *manager.RunnerManager

	// Orchestrator
	Orchestrator orchestrator.Orchestrator
}

Options defines the options for the API server.

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns the default options.

Jump to

Keyboard shortcuts

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