model

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndPointsCapacity = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EndPoint

type EndPoint struct {
	ID            int                 `json:"id"`
	BasePath      string              `json:"base_path"`
	DelayMinMs    int                 `json:"delay_min_ms"`
	DelayMaxMs    int                 `json:"delay_max_ms"`
	ReturnCode    int                 `json:"return_code"`
	ReturnHeaders map[string][]string `json:"return_headers"`
	ReturnBody    string              `json:"return_body"`
}

type EndPoints

type EndPoints struct {
	Map map[int]*EndPoint
}

func (*EndPoints) Add

func (e *EndPoints) Add(ep *EndPoint) error

func (*EndPoints) Delete

func (e *EndPoints) Delete(id int) error

func (*EndPoints) FirstID

func (e *EndPoints) FirstID() int

func (*EndPoints) GetByPath

func (e *EndPoints) GetByPath(path string) *EndPoint

func (*EndPoints) IsPrefixed

func (e *EndPoints) IsPrefixed(id int, path string) (bool, string)

func (*EndPoints) LastID

func (e *EndPoints) LastID() int

func (*EndPoints) List

func (e *EndPoints) List() []*EndPoint

func (*EndPoints) Update

func (e *EndPoints) Update(id int, ep *EndPoint) error

Jump to

Keyboard shortcuts

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