mock

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(opts GenerateOptions) error

Types

type Format

type Format string
const (
	FormatJSON Format = "json"
	FormatYAML Format = "yaml"
	FormatXML  Format = "xml"
)

type GenerateOptions

type GenerateOptions struct {
	SpecPath   string
	OutputDir  string
	SchemaName string
	Format     Format
}

type Route

type Route struct {
	Method      string
	Path        string
	StatusCode  int
	ContentType string
	Body        []byte
}

func BuildRoutes

func BuildRoutes(specPath string) ([]Route, error)

type Server

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

func Serve

func Serve(ctx context.Context, opts ServerOptions) (*Server, error)

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

func (*Server) URL

func (s *Server) URL() string

func (*Server) Wait

func (s *Server) Wait() error

type ServerOptions

type ServerOptions struct {
	SpecPath string
	Port     int
}

Jump to

Keyboard shortcuts

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