router_dto

package
v1.1.1-beta Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToServiceProxy

func ToServiceProxy(proxy *InputProxy) *api.Proxy

Types

type Create

type Create struct {
	Id          string      `json:"id"`
	Path        string      `json:"path"`
	Methods     []string    `json:"methods"`
	Description string      `json:"description"`
	Protocols   []string    `json:"protocols"`
	MatchRules  []Match     `json:"match"`
	Proxy       *InputProxy `json:"proxy"`
	Disable     bool        `json:"disable"`
}

func (*Create) Validate

func (a *Create) Validate() error

type Detail

type Detail struct {
	SimpleDetail
	Proxy     *Proxy   `json:"proxy"`
	Protocols []string `json:"protocols"`
	Disable   bool     `json:"disable"`
}

type Edit

type Edit struct {
	Description *string     `json:"description"`
	Proxy       *InputProxy `json:"proxy"`
	Path        *string     `json:"path"`
	Methods     *[]string   `json:"methods"`
	Protocols   *[]string   `json:"protocols"`
	MatchRules  *[]Match    `json:"match"`
	Disable     *bool       `json:"disable"`
}

type Export

type Export struct {
	Id          string                 `json:"id"`
	Name        string                 `json:"name"`
	Description string                 `json:"description"`
	Method      []string               `json:"method"`
	Path        string                 `json:"path"`
	MatchRules  []Match                `json:"match"`
	Service     string                 `json:"service"`
	Team        string                 `json:"team"`
	Proxy       *Proxy                 `json:"proxy"`
	Doc         map[string]interface{} `json:"doc"`
}
type Header struct {
	Key   string `json:"key"`
	Value string `json:"value"`
	Opt   string `json:"opt"`
}

type InputProxy

type InputProxy struct {
	Path    string                       `json:"path"`
	Timeout int                          `json:"timeout"`
	Retry   int                          `json:"retry"`
	Headers []*Header                    `json:"headers"`
	Extends map[string]any               `json:"extends"`
	Plugins map[string]api.PluginSetting `json:"plugins"`
}

type Item

type Item struct {
	Id          string         `json:"id"`
	Methods     []string       `json:"methods"`
	Protocols   []string       `json:"protocols"`
	Path        string         `json:"request_path"`
	Description string         `json:"description"`
	Disable     bool           `json:"disable"`
	Creator     auto.Label     `json:"creator" aolabel:"user"`
	Updater     auto.Label     `json:"updater" aolabel:"user"`
	CreateTime  auto.TimeLabel `json:"create_time"`
	UpdateTime  auto.TimeLabel `json:"update_time"`
	CanDelete   bool           `json:"can_delete"`
}

type ListInput

type ListInput struct {
	Projects []string `json:"projects"`
}

type Match

type Match struct {
	Position  string `json:"position"`
	MatchType string `json:"match_type"`
	Key       string `json:"key"`
	Pattern   string `json:"pattern"`
}

type Proxy

type Proxy struct {
	Path    string                       `json:"path"`
	Timeout int                          `json:"timeout"`
	Retry   int                          `json:"retry"`
	Headers []*Header                    `json:"headers"`
	Extends map[string]any               `json:"extends"`
	Plugins map[string]api.PluginSetting `json:"plugins"`
}

func FromServiceProxy

func FromServiceProxy(proxy *api.Proxy) *Proxy

type SimpleDetail

type SimpleDetail struct {
	Id          string         `json:"id"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Methods     []string       `json:"methods"`
	Path        string         `json:"path"`
	Protocols   []string       `json:"protocols"`
	MatchRules  []Match        `json:"match"`
	Creator     auto.Label     `json:"creator" aolabel:"user"`
	Updater     auto.Label     `json:"updater" aolabel:"user"`
	CreateTime  auto.TimeLabel `json:"create_time"`
	UpdateTime  auto.TimeLabel `json:"update_time"`
}

func GenSimpleDetail

func GenSimpleDetail(api *api.Info) *SimpleDetail

type SimpleItem

type SimpleItem struct {
	Id      string   `json:"id"`
	Methods []string `json:"methods"`
	Path    string   `json:"request_path"`
}

type UpdateDoc

type UpdateDoc struct {
	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

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