rmi

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteRules

func DeleteRules(c *gin.Context)

DeleteRules deletes rmi rule from user submit

func ListRules

func ListRules(c *gin.Context)

ListRules lists all rmi rules those satisfy the filter

func Records added in v0.2.1

func Records(c *gin.Context)

func UpsertRules

func UpsertRules(c *gin.Context)

UpsertRules creates or updates rmi rule from user submit

Types

type Config

type Config struct {
	Enable bool
	Addr   string
}

type Record

type Record struct {
	Path string `form:"path" json:"path"`
	record.BaseRecord
	Rule Rule `gorm:"foreignKey:RuleName;references:Name;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;" form:"-" json:"-" notice:"-"`
}

func NewRecord

func NewRecord(rule *Rule, flag, path, ip, area string) (r *Record, err error)

func (Record) Notice

func (r Record) Notice()

func (Record) TableName

func (Record) TableName() string

type Rule

type Rule struct {
	rule.BaseRule `yaml:",inline"`
}

Rule RMI rule struct

func NewRule

func NewRule(name, flagFormat string, pushToClient, notice bool) *Rule

NewRule new rmi rule struct

func (*Rule) CreateOrUpdate

func (r *Rule) CreateOrUpdate() (err error)

CreateOrUpdate creates or updates the rmi rule in database and ruleSet

func (*Rule) Delete

func (r *Rule) Delete() (err error)

Delete deletes the rmi rule in database and ruleSet

func (Rule) TableName

func (Rule) TableName() string

type Server

type Server struct {
	Config
	// contains filtered or unexported fields
}

func GetServer

func GetServer() *Server

func (*Server) Restart

func (s *Server) Restart()

func (*Server) Run

func (s *Server) Run()

func (*Server) Stop

func (s *Server) Stop()

func (*Server) UpdateRules

func (s *Server) UpdateRules() error

Jump to

Keyboard shortcuts

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