aliyun

package module
v0.0.0-...-2b3ac45 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 10 Imported by: 1

README

aliyun

aliyun api

Documentation

Index

Constants

View Source
const (
	ID            = "aliyun"
	Comment       = "aliyun api"
	RoutePrefix   = "/" + ID
	DefaultEnable = false
)

Variables

View Source
var Module = module.Module{
	ID:      ID,
	Comment: Comment,

	RouteFunc:   AddRoute,
	RoutePrefix: RoutePrefix,

	FlagFunc: ServeFlag,
}

Functions

func AddRoute

func AddRoute(g *gin.Engine)

func Allow

func Allow(c *gin.Context)

func IsIPv4

func IsIPv4(ip string) bool

func IsLanIPv4

func IsLanIPv4(ip string) bool

func NewClient

func NewClient() *ecs.Client

func ServeFlag

func ServeFlag(serveCmd *cobra.Command)

Types

type AliyunAccessKey

type AliyunAccessKey struct {
	ACCESS_KEY_ID     string
	ACCESS_KEY_SECRET string
	REGION_ID         string
}

type SGRule

type SGRule struct {
	IP     string `json:"ip" form:"ip" validate:"required,ip"`
	SGID   string `json:"sgid" form:"sgid" validate:"required"`
	Remark string `json:"remark" form:"remark" validate:"required"`
	Policy string `json:"policy" form:"policy"` // 默认 accept, 可选 drop
}

Jump to

Keyboard shortcuts

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