api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Address = "0.0.0.0"
	Port    = 9765
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DBClient  *db.Client
	EnableSSE bool `env:"ENABLE_SSE"`
}

func LoadConfig

func LoadConfig(DBClient *db.Client) (cfg Config, fault error)

type Server

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

func New

func New(ctx context.Context, cfg Config) (server Server, fault error)

func (*Server) Start

func (srvr *Server) Start(ctx context.Context) error

type StatusError

type StatusError struct {
	Code      int
	Err       error
	RequestID string
}

StatusError represents an error with an associated HTTP status code.

func NewStatusError

func NewStatusError(ctx context.Context, code int, err error) StatusError

func (StatusError) Error

func (statusErr StatusError) Error() string

Allows StatusError to satisfy the error interface.

func (StatusError) MarshalJSON

func (statusErr StatusError) MarshalJSON() ([]byte, error)

func (StatusError) Status

func (statusErr StatusError) Status() int

Status returns our HTTP status code.

func (StatusError) String

func (statusErr StatusError) String() string

String returns our HTTP status code.

Directories

Path Synopsis
Package oapi provides primitives to interact with the openapi HTTP API.
Package oapi provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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