esentinel

package
v1.1.19 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const PackageName = "core.sentinel"

PackageName component name

Variables

This section is empty.

Functions

func IsResExist added in v1.1.10

func IsResExist(res string) bool

IsResExist check if a resource exists

Types

type Component

type Component struct {
}

Component defines component's configuration schema, name, logger, etc.

type Config

type Config struct {
	AppName       string `json:"appName"`       // 应用名,默认从ego框架内部获取
	LogPath       string `json:"logPath"`       // 日志路径,默认./logs
	FlowRulesFile string `json:"flowRulesFile"` // 限流配置路径
}

Config defines component configuration schema

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns default config for sentinel

type Container

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

Container defines a component instance.

func DefaultContainer

func DefaultContainer() *Container

DefaultContainer returns an default container.

func Load

func Load(key string) *Container

Load parses container configuration from configuration provider, such as a toml file, then use the configuration to construct a component container.

func (*Container) Build

func (c *Container) Build(options ...Option)

Build constructs a specific component from container.

type Option

type Option func(c *Container)

Option overrides a Container's default configuration.

Jump to

Keyboard shortcuts

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