mock

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct {
	ID          string            `json:"id"`
	Name        string            `json:"name,omitempty"`
	Method      string            `json:"method,omitempty"`
	URLPattern  string            `json:"url_pattern"`
	Status      int               `json:"status"`
	Headers     map[string]string `json:"headers,omitempty"`
	Body        string            `json:"body,omitempty"`
	ContentType string            `json:"content_type,omitempty"`
}

func (*Rule) Matches

func (r *Rule) Matches(req *http.Request) bool

type Store

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

func NewStore

func NewStore(path string) *Store

func (*Store) Add

func (s *Store) Add(r *Rule) error

func (*Store) Clear

func (s *Store) Clear() error

func (*Store) Match

func (s *Store) Match(req *http.Request) *Rule

func (*Store) Remove

func (s *Store) Remove(id string) (bool, error)

func (*Store) Rules

func (s *Store) Rules() []*Rule

Jump to

Keyboard shortcuts

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