api_dto

package
v1.0.0-beta Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToServiceDocument

func ToServiceDocument(doc map[string]interface{}) *api.Document

func ToServiceProxy

func ToServiceProxy(proxy *InputProxy) *api.Proxy

Types

type ApiDetail

type ApiDetail struct {
	ApiSimpleDetail
	Proxy *Proxy                 `json:"proxy"`
	Doc   map[string]interface{} `json:"doc"`
}

type ApiDocDetail

type ApiDocDetail struct {
	ApiSimpleDetail
	Doc map[string]interface{} `json:"doc"`
}

type ApiItem

type ApiItem struct {
	Id         string         `json:"id"`
	Name       string         `json:"name"`
	Method     string         `json:"method"`
	Path       string         `json:"request_path"`
	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 ApiProxyDetail

type ApiProxyDetail struct {
	ApiSimpleDetail
	Proxy *Proxy `json:"proxy"`
}

type ApiSimpleDetail

type ApiSimpleDetail 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"`
	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 GenApiSimpleDetail

func GenApiSimpleDetail(api *api.Info) *ApiSimpleDetail

type ApiSimpleItem

type ApiSimpleItem struct {
	Id     string `json:"id"`
	Name   string `json:"name"`
	Method string `json:"method"`
	Path   string `json:"request_path"`
}

type CreateApi

type CreateApi struct {
	Id          string      `json:"id"`
	Name        string      `json:"name"`
	Path        string      `json:"path"`
	Method      string      `json:"method"`
	Description string      `json:"description"`
	MatchRules  []Match     `json:"match"`
	Proxy       *InputProxy `json:"proxy"`
}

func (*CreateApi) ToServiceRouter

func (a *CreateApi) ToServiceRouter() *api.Router

func (*CreateApi) Validate

func (a *CreateApi) Validate() error

type EditApi

type EditApi struct {
	Info struct {
		Name        *string `json:"name"`
		Description *string `json:"description"`
	} `json:"info"`
	Proxy *InputProxy             `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"`
	//Upstream string    `json:"upstream" aocheck:"upstream"`
	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 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

Jump to

Keyboard shortcuts

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