Documentation
¶
Index ¶
Constants ¶
View Source
const ( WILL_FIT uint8 = iota // debug level SHOULD_FIT // info MAY_FIT // warning WONT_FIT // fatal )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
Action ActionType `json:"action"` // Type of action to take when the rule is matched
ToAddr string `json:"to_addr"` // Address to FORWARD to, if type is FORWARD
}
Action is a struct representing an action to be taken on a request that matches a rule
type ActionType ¶
type ActionType uint8
const ( ACTION_REJECT ActionType = iota // "REJECT" - 0 ACTION_FORWARD // "FORWARD" - 1 )
func (*ActionType) MarshalJSON ¶
func (at *ActionType) MarshalJSON() ([]byte, error)
func (*ActionType) UnmarshalJSON ¶
func (at *ActionType) UnmarshalJSON(data []byte) error
type Config ¶
type Config struct {
Version Version `json:"version"`
Servers ServerGroup `json:"servers"` // A list of servers to listen on
}
Config is a struct that can be loaded from a JSON file or written to a JSON file
func LoadConfig ¶
type Protocol ¶
type Protocol = string // E.g.: "TLS", "SSH"
Protocol is a string representing the protocol name
type ProtocolGroup ¶
ProtocolGroup includes filters to apply to the request per each protocol
type Rule ¶
type Rule = string // E.g.: "SNI example.com", "CATCHALL"
Rule is a string that can be matched against a request by a filter
type ServerAddr ¶
type ServerAddr = string
type ServerGroup ¶
type ServerGroup = map[ServerAddr]ProtocolGroup
ServerGroup is a map of server address to protocol filters
type Version ¶
Version is a struct that represents the version of the config file v1.2.3 would be represented as:
Version{
Major: 1,
Minor: 2,
Patch: 3,
}
func (*Version) CanFitInServer ¶
func (*Version) MarshalJSON ¶
func (*Version) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.