server

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port     int
	SpecPath string
}

type Endpoint

type Endpoint struct {
	Method        string `json:"method"`
	Path          string `json:"path"`
	OperationID   string `json:"operationId,omitempty"`
	Summary       string `json:"summary,omitempty"`
	DefaultStatus int    `json:"defaultStatus,omitempty"`
	DefaultBody   any    `json:"defaultBody,omitempty"`
}

type Server

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

func New

func New(cfg Config) (*Server, error)

func (*Server) Run

func (s *Server) Run() error

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Stub

type Stub struct {
	Status  int               `json:"status"`
	Headers map[string]string `json:"headers,omitempty"`
	Body    any               `json:"body,omitempty"`
}

Jump to

Keyboard shortcuts

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