Documentation ¶
Index ¶
- Variables
- func AppendAAAARecordToResponse(state request.Request, response *PolicyResponse, ttl int, ...) error
- func AppendARecordToResponse(state request.Request, response *PolicyResponse, ttl int, ...) error
- func AppendExtraToResponse(state request.Request, value json.RawMessage, response *PolicyResponse) error
- func AppendInAddrToResponse(state request.Request, aliastype string, response *PolicyResponse) error
- func AppendRcodeToResponse(state request.Request, value json.RawMessage, response *PolicyResponse) error
- func AppendRecordToResponse(state request.Request, value json.RawMessage, response *PolicyResponse) error
- func CreateDnsRecord(qname string, qtype uint16, ttl uint32, address string) *dns.A
- func HandleLogResponse(state request.Request, value json.RawMessage, result *matches.MatchResult, ...) error
- func LogFormatResponse(f os.File, msg LogMessage, format string) error
- func LogJsonResponse(f os.File, msg LogMessage) error
- func StringToRcode(s string) (uint16, error)
- func WriteExtraHandle(msg *dns.Msg, state request.Request, extra []string)
- type LogMessage
- type LogResponse
- type PolicyRecord
- type PolicyResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLogFormat = "{{.Time}} [consulrpz] {{.RemoteIP}} made {{.QType}} query for {{.QName}}"
Functions ¶
func AppendAAAARecordToResponse ¶
func AppendAAAARecordToResponse(state request.Request, response *PolicyResponse, ttl int, value json.RawMessage) error
func AppendARecordToResponse ¶
func AppendARecordToResponse(state request.Request, response *PolicyResponse, ttl int, value json.RawMessage) error
func AppendExtraToResponse ¶
func AppendExtraToResponse(state request.Request, value json.RawMessage, response *PolicyResponse) error
func AppendInAddrToResponse ¶
func AppendInAddrToResponse(state request.Request, aliastype string, response *PolicyResponse) error
func AppendRcodeToResponse ¶
func AppendRcodeToResponse(state request.Request, value json.RawMessage, response *PolicyResponse) error
func AppendRecordToResponse ¶
func AppendRecordToResponse(state request.Request, value json.RawMessage, response *PolicyResponse) error
func CreateDnsRecord ¶
func HandleLogResponse ¶
func HandleLogResponse(state request.Request, value json.RawMessage, result *matches.MatchResult, policy policies.Policy, response *PolicyResponse) error
func LogFormatResponse ¶
func LogFormatResponse(f os.File, msg LogMessage, format string) error
func LogJsonResponse ¶
func LogJsonResponse(f os.File, msg LogMessage) error
func StringToRcode ¶
Types ¶
type LogMessage ¶
type LogResponse ¶
type PolicyRecord ¶
type PolicyRecord struct { TTL *int `json:"ttl"` Records []struct { Type string `json:"type"` Value json.RawMessage `json:"value"` } `json:"records"` }
func (PolicyRecord) GetRecordTTL ¶
func (record PolicyRecord) GetRecordTTL() int
type PolicyResponse ¶
type PolicyResponse struct { Deny bool `json:"deny"` Fallthrough bool `json:"fallthrough"` Rcode *uint16 `json:"rcode"` Records []dns.RR `json:"records"` Extra []string `json:"extra"` }
func HandleResponse ¶
func HandleResponse(state request.Request, ctx context.Context, server string, result *matches.MatchResult, policy policies.Policy, rule policies.PolicyRule) (*PolicyResponse, error)
Click to show internal directories.
Click to hide internal directories.