github.com/TeaOSLab/EdgeNode@v1.3.8/internal/iplibrary/action_interface.go (about)

     1  package iplibrary
     2  
     3  import (
     4  	"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
     5  	"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/firewallconfigs"
     6  	"net/http"
     7  )
     8  
     9  type ActionInterface interface {
    10  	// Init 初始化
    11  	Init(config *firewallconfigs.FirewallActionConfig) error
    12  
    13  	// AddItem 添加
    14  	AddItem(listType IPListType, item *pb.IPItem) error
    15  
    16  	// DeleteItem 删除
    17  	DeleteItem(listType IPListType, item *pb.IPItem) error
    18  
    19  	// Close 关闭
    20  	Close() error
    21  
    22  	// DoHTTP 处理HTTP请求
    23  	DoHTTP(req *http.Request, resp http.ResponseWriter) (goNext bool, err error)
    24  }