fallback

package
v1.0.5-aliyun-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadRules

func LoadRules(rules []*Rule) (bool, error)

Types

type FunctionType

type FunctionType int64
const (
	FlowType    FunctionType = 1
	Isolation   FunctionType = 6
	HotspotRpc  FunctionType = 4
	HotspotHttp FunctionType = 11
)

type RpcBlockFallbackBehavior

type RpcBlockFallbackBehavior struct {
	RpcFallbackMode             int64  `json:"rpcFallbackMode"`
	RpcFallbackCacheMode        int64  `json:"rpcFallbackCacheMode"`
	RpcRespFallbackClassName    string `json:"rpcRespFallbackClassName"`
	RpcFallbackExceptionMessage string `json:"rpcFallbackExceptionMessage"`
	RpcRespContentBody          string `json:"rpcRespContentBody"`
}

func GetRpcFallbackBehavior

func GetRpcFallbackBehavior(resource string, blockType base.BlockType) (*RpcBlockFallbackBehavior, bool)

type Rule

type Rule struct {
	TargetResourceType TargetResourceType        `json:"targetResourceType"`
	TargetMap          map[string][]FunctionType `json:"targetMap"`
	FallbackBehavior   interface{}               `json:"fallbackBehavior"`
}

type TargetResourceType

type TargetResourceType int64
const (
	WebResourceType TargetResourceType = 1
	RpcResourceType TargetResourceType = 2
)

type WebBlockFallbackBehavior

type WebBlockFallbackBehavior struct {
	WebFallbackMode    int64  `json:"webFallbackMode"` // 0: return, 1: redirect
	WebRespStatusCode  int64  `json:"webRespStatusCode"`
	WebRespMessage     string `json:"webRespMessage"`
	WebRespContentType int64  `json:"webRespContentType"` // 0: test, 1: json
	WebRedirectUrl     string `json:"webRedirectUrl"`
}

func GetWebFallbackBehavior

func GetWebFallbackBehavior(resource string, blockType base.BlockType) (*WebBlockFallbackBehavior, bool)

Jump to

Keyboard shortcuts

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