entity

package
v1.4.2-beta Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	*BasicInfo
	Labels         map[string]string `json:"labels"`
	Authorizations []*Authorization  `json:"auth"`
}

type AuthUser

type AuthUser struct {
	Expire         int64             `json:"expire"`
	Pattern        interface{}       `json:"pattern"`
	HideCredential bool              `json:"hide_credential"`
	Labels         map[string]string `json:"labels"`
}

type Authorization

type Authorization struct {
	Type      string            `json:"type"`
	Position  string            `json:"position"`
	TokenName string            `json:"token_name"`
	Config    interface{}       `json:"config"`
	Users     []*AuthUser       `json:"users"`
	Labels    map[string]string `json:"labels"`
}

type BasicInfo

type BasicInfo struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Driver      string            `json:"driver"`
	Version     string            `json:"version"`
	Matches     map[string]string `json:"matches"`
}

type Plugin

type Plugin struct {
	Disable bool        `json:"disable"`
	Config  interface{} `json:"config"`
}

type PluginProxyRewriteV2Config

type PluginProxyRewriteV2Config struct {
	PathType    string            `json:"path_type"`
	StaticPath  string            `json:"static_path,omitempty"` //path_type=static启用
	PrefixPath  []*PrefixPath     `json:"prefix_path,omitempty"` //path_type=prefix 启用
	RegexPath   []*RegexPath      `json:"regex_path,omitempty"`  //path_type=regex 启用
	NotMatchErr bool              `json:"not_match_err"`
	HostRewrite bool              `json:"host_rewrite"`
	Host        string            `json:"host,omitempty"`
	Headers     map[string]string `json:"headers"`
}

type PrefixPath

type PrefixPath struct {
	PrefixPathMatch   string `json:"prefix_path_match"`
	PrefixPathReplace string `json:"prefix_path_replace"`
}

type RegexPath

type RegexPath struct {
	RegexPathMatch   string `json:"regex_path_match"`
	RegexPathReplace string `json:"regex_path_replace"`
}

type Router

type Router struct {
	*BasicInfo
	Listen    int                `json:"listen"`
	Host      []string           `json:"host"`
	Method    []string           `json:"method"`
	Protocols []string           `json:"protocols"`
	Location  string             `json:"location"`
	Rules     []*Rule            `json:"rules"`
	Service   string             `json:"service"`
	Plugins   map[string]*Plugin `json:"plugins"`
	Retry     int                `json:"retry"`
	TimeOut   int                `json:"time_out"`
	Labels    map[string]string  `json:"labels"`
}

func ToRouter

func ToRouter(r *gateway.ApiRelease, version string, matches map[string]string) *Router

type Rule

type Rule struct {
	Type  string `json:"type"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Service

type Service struct {
	*BasicInfo
	Nodes    []string          `json:"nodes"`
	PassHost string            `json:"pass_host"`
	Scheme   string            `json:"scheme"`
	Timeout  int               `json:"timeout"`
	Balance  string            `json:"balance"`
	Labels   map[string]string `json:"labels"`
}

func ToService

func ToService(s *gateway.UpstreamRelease, version string, matches map[string]string) *Service

type WorkerItem

type WorkerItem[T any] struct {
	Basic *BasicInfo
	Attr  *T
}

func NewWorkerItem

func NewWorkerItem[T any](basic *BasicInfo, attr *T) *WorkerItem[T]

func (*WorkerItem[T]) MarshalJSON

func (w *WorkerItem[T]) MarshalJSON() ([]byte, error)

func (*WorkerItem[T]) UnmarshalJSON

func (w *WorkerItem[T]) UnmarshalJSON(bytes []byte) error

Jump to

Keyboard shortcuts

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