api_config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAllowedMethods

func CheckAllowedMethods(method string) bool

CheckAllowedMethods 允许方法

func CheckAllowedUserAgent

func CheckAllowedUserAgent(uaName string) bool

CheckAllowedUserAgent 检查UA是否在白名单

Types

type ApiConfig

type ApiConfig struct {
	Enabled           bool     `yaml:"enabled" json:"enabled"`
	Port              int      `yaml:"port" json:"port"`
	UserAgentAllowed  []string `yaml:"user_agent_allowed" json:"user_agent_allowed"`
	APIMethodsAllowed []string `yaml:"api_methods_allowed" json:"api_methods_allowed"`
}
var (
	CurrentApiConfig *ApiConfig
)

Jump to

Keyboard shortcuts

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