apipolicy

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CTX_IDENTIFY     = "id"
	CTX_K8S_CLIENT   = "k8s_client"
	CTX_KONG_ADAPTER = "kong_adapter"
	CTX_ZONE         = "zone"
	CTX_SERVICE_INFO = "service_info"
)

Variables

This section is empty.

Functions

func RegisterPolicyEngine

func RegisterPolicyEngine(name string, engine PolicyEngine) error

Types

type BaseDto

type BaseDto struct {
	Switch bool `json:"switch"`
	Global bool `json:"global"`
}

func (*BaseDto) Enable

func (dto *BaseDto) Enable() bool

func (BaseDto) IsGlobal

func (dto BaseDto) IsGlobal() bool

func (*BaseDto) SetEnable

func (dto *BaseDto) SetEnable(toggle bool)

func (*BaseDto) SetGlobal

func (dto *BaseDto) SetGlobal(isGlobal bool)

type BasePolicy

type BasePolicy struct {
	// contains filtered or unexported fields
}

func (BasePolicy) CreateDefaultConfig

func (policy BasePolicy) CreateDefaultConfig(map[string]interface{}) interface{}

func (BasePolicy) GetConfig

func (policy BasePolicy) GetConfig(name, packageId string, zone *orm.GatewayZone, ctx map[string]interface{}) (PolicyDto, error)

func (BasePolicy) GetName

func (policy BasePolicy) GetName() string

func (BasePolicy) MergeDiceConfig

func (policy BasePolicy) MergeDiceConfig(map[string]interface{}) (PolicyDto, error)

func (BasePolicy) NeedResetAnnotation

func (policy BasePolicy) NeedResetAnnotation(dto PolicyDto) bool

func (BasePolicy) NeedSerialUpdate

func (policy BasePolicy) NeedSerialUpdate() bool

func (BasePolicy) ParseConfig

func (policy BasePolicy) ParseConfig(interface{}, map[string]interface{}) (PolicyConfig, error)

func (*BasePolicy) SetName

func (policy *BasePolicy) SetName(name string)

func (BasePolicy) UnmarshalConfig

func (policy BasePolicy) UnmarshalConfig([]byte) (interface{}, error, string)

type IngressAnnotation

type IngressAnnotation struct {
	Annotation      map[string]*string
	LocationSnippet *string
}

type IngressController

type IngressController struct {
	ConfigOption  map[string]*string
	MainSnippet   *string
	HttpSnippet   *string
	ServerSnippet *string
}

type PolicyConfig

type PolicyConfig struct {
	KongPolicyChange  bool
	IngressAnnotation *IngressAnnotation
	IngressController *IngressController
	AnnotationReset   bool
}

type PolicyDto

type PolicyDto interface {
	SetGlobal(bool)
	IsGlobal() bool
	Enable() bool
	SetEnable(bool)
}

type PolicyEngine

type PolicyEngine interface {
	GetConfig(string, string, *orm.GatewayZone, map[string]interface{}) (PolicyDto, error)
	MergeDiceConfig(map[string]interface{}) (PolicyDto, error)
	CreateDefaultConfig(map[string]interface{}) PolicyDto
	ParseConfig(PolicyDto, map[string]interface{}) (PolicyConfig, error)
	NeedResetAnnotation(PolicyDto) bool
	UnmarshalConfig([]byte) (PolicyDto, error, string)
	SetName(name string)
	GetName() string
	NeedSerialUpdate() bool
}

func GetPolicyEngine

func GetPolicyEngine(name string) (PolicyEngine, error)

type ServiceInfo

type ServiceInfo struct {
	ProjectName string
	Env         string
}

Directories

Path Synopsis
policies
ip
waf

Jump to

Keyboard shortcuts

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