route

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExpressionVerifyEndpoint = &xreq.Endpoint{
	Path:    "/expression/verify",
	Method:  http.MethodPatch,
	Handler: xreq.Convert(ExpressionVerifyAction),

	Authorizer: nil,
}

Deprecated

View Source
var ListEndpoint = &xreq.Endpoint{
	Path:       "/products/{product_name}/routes",
	Method:     http.MethodGet,
	Handler:    xreq.Convert(ListAction),
	Authorizer: iauth.FAP(iauth.FeatureRoute, iauth.ActionRead),
}

ListRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

View Source
var UpsertEndpoint = &xreq.Endpoint{
	Path:       "/products/{product_name}/routes",
	Method:     http.MethodPatch,
	Handler:    xreq.Convert(UpsertAction),
	Authorizer: iauth.FAP(iauth.FeatureRoute, iauth.ActionUpdate),
}

UpsertRoute route AUTO GEN BY ctrl, MODIFY AS U NEED

Functions

func ExpressionVerifyAction

func ExpressionVerifyAction(req *http.Request) (interface{}, error)

ExpressionVerifyAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func ListAction

func ListAction(req *http.Request) (interface{}, error)

ListAction action AUTO GEN BY ctrl, MODIFY AS U NEED

func UpsertAction

func UpsertAction(req *http.Request) (interface{}, error)

UpsertAction action AUTO GEN BY ctrl, MODIFY AS U NEED

Types

type AdvanceRouteRule

type AdvanceRouteRule struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Expression  string `json:"expression" validate:"required,min=1"`
	ClusterName string `json:"cluster_name" validate:"required,min=1"`
}

type BasicRouteRule

type BasicRouteRule struct {
	HostNames   []string `json:"host_names"`
	Paths       []string `json:"paths"`
	ClusterName string   `json:"cluster_name" validate:"required,min=1"`
	Description string   `json:"description"`
}

type ExpressionVerifyParam

type ExpressionVerifyParam struct {
	Expression string `json:"expression" validate:"required,min=1"`
}

type ProductRouteRuleData

type ProductRouteRuleData struct {
	BasicRouteRules   []*BasicRouteRule   `json:"basic_forward_rules"`
	AdvanceRouteRules []*AdvanceRouteRule `json:"forward_rules"`

	RouteCasesCode int `json:"forward_cases_code,omitempty"`
}

func UpsertActionProcess

func UpsertActionProcess(req *http.Request, rule *ProductRouteRuleParam) (*ProductRouteRuleData, error)

type ProductRouteRuleParam

type ProductRouteRuleParam struct {
	BasicRouteRules   []*BasicRouteRule   `json:"basic_forward_rules" validate:"dive"`
	AdvanceRouteRules []*AdvanceRouteRule `json:"forward_rules" validate:"dive"`
}

type VerifyResult

type VerifyResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func ExpressionVerifyActionProcess

func ExpressionVerifyActionProcess(req *http.Request, param *ExpressionVerifyParam) (*VerifyResult, error)

Jump to

Keyboard shortcuts

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