Documentation
¶
Index ¶
- Variables
- func AuditActionNames() []string
- func AuditResourceTypeNames() []string
- func AuditSourceNames() []string
- func DNSRecordStrategyNames() []string
- func DNSRecordTypeNames() []string
- func EventProtocolNames() []string
- func HTTPMethodNames() []string
- func ProtoCategoryNames() []string
- func WithCaller(ctx context.Context, c Caller) context.Context
- type AuditAction
- type AuditRecord
- type AuditRecordsGet
- type AuditRecordsGetInput
- type AuditRecordsGetOutput
- type AuditRecordsList
- type AuditRecordsListInput
- type AuditRecordsListOutput
- type AuditResourceType
- type AuditSource
- type AuthContextByAPIToken
- type AuthContextByLarkID
- type AuthContextBySlackID
- type AuthContextByTelegramID
- type Caller
- type DNSRecord
- type DNSRecordStrategy
- type DNSRecordType
- type DNSRecordsClear
- type DNSRecordsClearInput
- type DNSRecordsClearOutput
- type DNSRecordsCreate
- type DNSRecordsCreateInput
- type DNSRecordsCreateOutput
- type DNSRecordsDelete
- type DNSRecordsDeleteInput
- type DNSRecordsDeleteOutput
- type DNSRecordsList
- type DNSRecordsListInput
- type DNSRecordsListOutput
- type Error
- type ErrorKind
- type Event
- type EventDNSAnswer
- type EventDNSMeta
- type EventDNSQuestion
- type EventFTPData
- type EventFTPMeta
- type EventGeoIPASN
- type EventGeoIPCountry
- type EventGeoIPMeta
- type EventHTTPMeta
- type EventHTTPRequest
- type EventHTTPResponse
- type EventMeta
- type EventProtocol
- type EventSMTPAddress
- type EventSMTPData
- type EventSMTPEmail
- type EventSMTPMeta
- type EventsGet
- type EventsGetInput
- type EventsGetOutput
- type EventsList
- type EventsListInput
- type EventsListOutput
- type HTTPMethod
- type HTTPRoute
- type HTTPRoutesClear
- type HTTPRoutesClearInput
- type HTTPRoutesClearOutput
- type HTTPRoutesCreate
- type HTTPRoutesCreateInput
- type HTTPRoutesCreateOutput
- type HTTPRoutesDelete
- type HTTPRoutesDeleteInput
- type HTTPRoutesDeleteOutput
- type HTTPRoutesList
- type HTTPRoutesListInput
- type HTTPRoutesListOutput
- type HTTPRoutesUpdate
- type HTTPRoutesUpdateInput
- type HTTPRoutesUpdateOutput
- type LarkProvisionUser
- type Payload
- type PayloadsClear
- type PayloadsClearInput
- type PayloadsClearOutput
- type PayloadsCreate
- type PayloadsCreateInput
- type PayloadsCreateOutput
- type PayloadsDelete
- type PayloadsDeleteInput
- type PayloadsDeleteOutput
- type PayloadsList
- type PayloadsListInput
- type PayloadsListOutput
- type PayloadsUpdate
- type PayloadsUpdateInput
- type PayloadsUpdateOutput
- type ProfileGet
- type ProfileGetOutput
- type ProtoCategory
- type ServerService
- type Service
- type User
- type UsersCreate
- type UsersCreateInput
- type UsersCreateOutput
- type UsersDelete
- type UsersDeleteInput
- type UsersDeleteOutput
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidAuditAction = fmt.Errorf("not a valid AuditAction, try [%s]", strings.Join(_AuditActionNames, ", "))
var ErrInvalidAuditResourceType = fmt.Errorf("not a valid AuditResourceType, try [%s]", strings.Join(_AuditResourceTypeNames, ", "))
var ErrInvalidAuditSource = fmt.Errorf("not a valid AuditSource, try [%s]", strings.Join(_AuditSourceNames, ", "))
var ErrInvalidDNSRecordStrategy = fmt.Errorf("not a valid DNSRecordStrategy, try [%s]", strings.Join(_DNSRecordStrategyNames, ", "))
var ErrInvalidDNSRecordType = fmt.Errorf("not a valid DNSRecordType, try [%s]", strings.Join(_DNSRecordTypeNames, ", "))
var ErrInvalidEventProtocol = fmt.Errorf("not a valid EventProtocol, try [%s]", strings.Join(_EventProtocolNames, ", "))
var ErrInvalidHTTPMethod = fmt.Errorf("not a valid HTTPMethod, try [%s]", strings.Join(_HTTPMethodNames, ", "))
var ErrInvalidProtoCategory = fmt.Errorf("not a valid ProtoCategory, try [%s]", strings.Join(_ProtoCategoryNames, ", "))
Functions ¶
func AuditActionNames ¶
func AuditActionNames() []string
AuditActionNames returns a list of possible string values of AuditAction.
func AuditResourceTypeNames ¶
func AuditResourceTypeNames() []string
AuditResourceTypeNames returns a list of possible string values of AuditResourceType.
func AuditSourceNames ¶
func AuditSourceNames() []string
AuditSourceNames returns a list of possible string values of AuditSource.
func DNSRecordStrategyNames ¶
func DNSRecordStrategyNames() []string
DNSRecordStrategyNames returns a list of possible string values of DNSRecordStrategy.
func DNSRecordTypeNames ¶
func DNSRecordTypeNames() []string
DNSRecordTypeNames returns a list of possible string values of DNSRecordType.
func EventProtocolNames ¶
func EventProtocolNames() []string
EventProtocolNames returns a list of possible string values of EventProtocol.
func HTTPMethodNames ¶
func HTTPMethodNames() []string
HTTPMethodNames returns a list of possible string values of HTTPMethod.
func ProtoCategoryNames ¶
func ProtoCategoryNames() []string
ProtoCategoryNames returns a list of possible string values of ProtoCategory.
Types ¶
type AuditAction ¶
type AuditAction string
ENUM(create, update, delete)
const ( // AuditActionCreate is a AuditAction of type create. AuditActionCreate AuditAction = "create" // AuditActionUpdate is a AuditAction of type update. AuditActionUpdate AuditAction = "update" // AuditActionDelete is a AuditAction of type delete. AuditActionDelete AuditAction = "delete" )
func AuditActionValues ¶
func AuditActionValues() []AuditAction
AuditActionValues returns a list of the values for AuditAction
func ParseAuditAction ¶
func ParseAuditAction(name string) (AuditAction, error)
ParseAuditAction attempts to convert a string to a AuditAction.
func (*AuditAction) Get ¶
func (x *AuditAction) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (AuditAction) IsValid ¶
func (x AuditAction) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (AuditAction) Ptr ¶
func (x AuditAction) Ptr() *AuditAction
func (*AuditAction) Set ¶
func (x *AuditAction) Set(val string) error
Set implements the Golang flag.Value interface func.
func (AuditAction) String ¶
func (x AuditAction) String() string
String implements the Stringer interface.
func (*AuditAction) Type ¶
func (x *AuditAction) Type() string
Type implements the github.com/spf13/pFlag Value interface.
type AuditRecord ¶
type AuditRecord struct {
ID int64 `json:"id"`
UUID string `json:"uuid"`
CreatedAt time.Time `json:"createdAt"`
Action AuditAction `json:"action"`
ResourceType AuditResourceType `json:"resourceType"`
Source AuditSource `json:"source"`
ActorID *int64 `json:"actorId,omitempty"`
ActorName string `json:"actorName,omitempty"`
ActorMeta map[string]any `json:"actorMetadata"`
Resource json.RawMessage `json:"resource"`
}
type AuditRecordsGet ¶
type AuditRecordsGet interface {
AuditRecordsGet(context.Context, AuditRecordsGetInput) (*AuditRecordsGetOutput, error)
}
type AuditRecordsGetInput ¶
type AuditRecordsGetInput struct {
ID int64
}
func (AuditRecordsGetInput) Validate ¶
func (in AuditRecordsGetInput) Validate() v.Problems
type AuditRecordsGetOutput ¶
type AuditRecordsGetOutput AuditRecord
type AuditRecordsList ¶
type AuditRecordsList interface {
AuditRecordsList(context.Context, AuditRecordsListInput) (AuditRecordsListOutput, error)
}
type AuditRecordsListInput ¶
type AuditRecordsListInput struct {
ActorID *int64
ActorName string
ResourceType AuditResourceType
Action AuditAction
From *time.Time
To *time.Time
Page uint
PerPage uint
}
type AuditRecordsListOutput ¶
type AuditRecordsListOutput []AuditRecord
type AuditResourceType ¶
type AuditResourceType string
ENUM(payload, user, dns_record, http_route)
const ( // AuditResourceTypePayload is a AuditResourceType of type payload. AuditResourceTypePayload AuditResourceType = "payload" // AuditResourceTypeUser is a AuditResourceType of type user. AuditResourceTypeUser AuditResourceType = "user" // AuditResourceTypeDnsRecord is a AuditResourceType of type dns_record. AuditResourceTypeDnsRecord AuditResourceType = "dns_record" // AuditResourceTypeHttpRoute is a AuditResourceType of type http_route. AuditResourceTypeHttpRoute AuditResourceType = "http_route" )
func AuditResourceTypeValues ¶
func AuditResourceTypeValues() []AuditResourceType
AuditResourceTypeValues returns a list of the values for AuditResourceType
func ParseAuditResourceType ¶
func ParseAuditResourceType(name string) (AuditResourceType, error)
ParseAuditResourceType attempts to convert a string to a AuditResourceType.
func (*AuditResourceType) Get ¶
func (x *AuditResourceType) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (AuditResourceType) IsValid ¶
func (x AuditResourceType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (AuditResourceType) Ptr ¶
func (x AuditResourceType) Ptr() *AuditResourceType
func (*AuditResourceType) Set ¶
func (x *AuditResourceType) Set(val string) error
Set implements the Golang flag.Value interface func.
func (AuditResourceType) String ¶
func (x AuditResourceType) String() string
String implements the Stringer interface.
func (*AuditResourceType) Type ¶
func (x *AuditResourceType) Type() string
Type implements the github.com/spf13/pFlag Value interface.
type AuditSource ¶
type AuditSource string
ENUM(api, telegram, lark, slack)
const ( // AuditSourceApi is a AuditSource of type api. AuditSourceApi AuditSource = "api" // AuditSourceTelegram is a AuditSource of type telegram. AuditSourceTelegram AuditSource = "telegram" // AuditSourceLark is a AuditSource of type lark. AuditSourceLark AuditSource = "lark" // AuditSourceSlack is a AuditSource of type slack. AuditSourceSlack AuditSource = "slack" )
func AuditSourceValues ¶
func AuditSourceValues() []AuditSource
AuditSourceValues returns a list of the values for AuditSource
func ParseAuditSource ¶
func ParseAuditSource(name string) (AuditSource, error)
ParseAuditSource attempts to convert a string to a AuditSource.
func (*AuditSource) Get ¶
func (x *AuditSource) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (AuditSource) IsValid ¶
func (x AuditSource) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (AuditSource) Ptr ¶
func (x AuditSource) Ptr() *AuditSource
func (*AuditSource) Set ¶
func (x *AuditSource) Set(val string) error
Set implements the Golang flag.Value interface func.
func (AuditSource) String ¶
func (x AuditSource) String() string
String implements the Stringer interface.
func (*AuditSource) Type ¶
func (x *AuditSource) Type() string
Type implements the github.com/spf13/pFlag Value interface.
type AuthContextByAPIToken ¶
type AuthContextByLarkID ¶
type AuthContextBySlackID ¶
type AuthContextByTelegramID ¶
type Caller ¶
type Caller struct {
UserID int64
UserName string
IsAdmin bool
Source AuditSource
TelegramID *int64
LarkID *string
SlackID *string
}
Caller is the authenticated identity behind a request. It is minted by the auth boundary (see dbsvc.AuthContextBy*) and carried through the request context. It holds everything downstream needs about the actor — including the name and social IDs — so consumers like auditsvc don't have to re-query the user from the database.
type DNSRecord ¶
type DNSRecord struct {
Index int64 `json:"index"`
PayloadSubdomain string `json:"payloadSubdomain"`
Name string `json:"name"`
Type DNSRecordType `json:"type"`
TTL int `json:"ttl"`
Values []string `json:"values"`
Strategy DNSRecordStrategy `json:"strategy"`
CreatedAt time.Time `json:"createdAt"`
}
type DNSRecordStrategy ¶
type DNSRecordStrategy string
ENUM(all, round-robin, rebind)
const ( // DNSRecordStrategyAll is a DNSRecordStrategy of type all. DNSRecordStrategyAll DNSRecordStrategy = "all" // DNSRecordStrategyRoundRobin is a DNSRecordStrategy of type round-robin. DNSRecordStrategyRoundRobin DNSRecordStrategy = "round-robin" // DNSRecordStrategyRebind is a DNSRecordStrategy of type rebind. DNSRecordStrategyRebind DNSRecordStrategy = "rebind" )
func DNSRecordStrategyValues ¶
func DNSRecordStrategyValues() []DNSRecordStrategy
DNSRecordStrategyValues returns a list of the values for DNSRecordStrategy
func ParseDNSRecordStrategy ¶
func ParseDNSRecordStrategy(name string) (DNSRecordStrategy, error)
ParseDNSRecordStrategy attempts to convert a string to a DNSRecordStrategy.
func (*DNSRecordStrategy) Get ¶
func (x *DNSRecordStrategy) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (DNSRecordStrategy) IsValid ¶
func (x DNSRecordStrategy) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (DNSRecordStrategy) Ptr ¶
func (x DNSRecordStrategy) Ptr() *DNSRecordStrategy
func (*DNSRecordStrategy) Set ¶
func (x *DNSRecordStrategy) Set(val string) error
Set implements the Golang flag.Value interface func.
func (DNSRecordStrategy) String ¶
func (x DNSRecordStrategy) String() string
String implements the Stringer interface.
func (*DNSRecordStrategy) Type ¶
func (x *DNSRecordStrategy) Type() string
Type implements the github.com/spf13/pFlag Value interface.
type DNSRecordType ¶
type DNSRecordType string
ENUM(A, AAAA, MX, TXT, CNAME, NS, CAA)
const ( // DNSRecordTypeA is a DNSRecordType of type A. DNSRecordTypeA DNSRecordType = "A" // DNSRecordTypeAAAA is a DNSRecordType of type AAAA. DNSRecordTypeAAAA DNSRecordType = "AAAA" // DNSRecordTypeMX is a DNSRecordType of type MX. DNSRecordTypeMX DNSRecordType = "MX" // DNSRecordTypeTXT is a DNSRecordType of type TXT. DNSRecordTypeTXT DNSRecordType = "TXT" // DNSRecordTypeCNAME is a DNSRecordType of type CNAME. DNSRecordTypeCNAME DNSRecordType = "CNAME" // DNSRecordTypeNS is a DNSRecordType of type NS. DNSRecordTypeNS DNSRecordType = "NS" // DNSRecordTypeCAA is a DNSRecordType of type CAA. DNSRecordTypeCAA DNSRecordType = "CAA" )
func DNSRecordTypeValues ¶
func DNSRecordTypeValues() []DNSRecordType
DNSRecordTypeValues returns a list of the values for DNSRecordType
func ParseDNSRecordType ¶
func ParseDNSRecordType(name string) (DNSRecordType, error)
ParseDNSRecordType attempts to convert a string to a DNSRecordType.
func (*DNSRecordType) Get ¶
func (x *DNSRecordType) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (DNSRecordType) IsValid ¶
func (x DNSRecordType) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (DNSRecordType) Ptr ¶
func (x DNSRecordType) Ptr() *DNSRecordType
func (*DNSRecordType) Set ¶
func (x *DNSRecordType) Set(val string) error
Set implements the Golang flag.Value interface func.
func (DNSRecordType) String ¶
func (x DNSRecordType) String() string
String implements the Stringer interface.
func (*DNSRecordType) Type ¶
func (x *DNSRecordType) Type() string
Type implements the github.com/spf13/pFlag Value interface.
type DNSRecordsClear ¶
type DNSRecordsClear interface {
DNSRecordsClear(context.Context, DNSRecordsClearInput) (DNSRecordsClearOutput, error)
}
type DNSRecordsClearInput ¶
func (DNSRecordsClearInput) Validate ¶
func (in DNSRecordsClearInput) Validate() v.Problems
type DNSRecordsClearOutput ¶
type DNSRecordsClearOutput []DNSRecord
type DNSRecordsCreate ¶
type DNSRecordsCreate interface {
DNSRecordsCreate(context.Context, DNSRecordsCreateInput) (*DNSRecordsCreateOutput, error)
}
type DNSRecordsCreateInput ¶
type DNSRecordsCreateInput struct {
PayloadName string
Name string
TTL int
Type DNSRecordType
Values []string
Strategy DNSRecordStrategy
}
func (DNSRecordsCreateInput) Validate ¶
func (in DNSRecordsCreateInput) Validate() v.Problems
type DNSRecordsCreateOutput ¶
type DNSRecordsCreateOutput DNSRecord
type DNSRecordsDelete ¶
type DNSRecordsDelete interface {
DNSRecordsDelete(context.Context, DNSRecordsDeleteInput) (*DNSRecordsDeleteOutput, error)
}
type DNSRecordsDeleteInput ¶
func (DNSRecordsDeleteInput) Validate ¶
func (in DNSRecordsDeleteInput) Validate() v.Problems
type DNSRecordsDeleteOutput ¶
type DNSRecordsDeleteOutput DNSRecord
type DNSRecordsList ¶
type DNSRecordsList interface {
DNSRecordsList(context.Context, DNSRecordsListInput) (DNSRecordsListOutput, error)
}
type DNSRecordsListInput ¶
type DNSRecordsListInput struct {
PayloadName string
}
func (DNSRecordsListInput) Validate ¶
func (in DNSRecordsListInput) Validate() v.Problems
type DNSRecordsListOutput ¶
type DNSRecordsListOutput []DNSRecord
type Error ¶
type Error struct {
Kind ErrorKind
Message string
Problems map[string]string // field -> problem; validation only
}
func BadRequestf ¶
func Forbiddenf ¶
func Unauthorized ¶
func Unauthorized() Error
func Validation ¶
type Event ¶
type Event struct {
Index int64 `json:"index"`
UUID string `json:"uuid"`
Protocol EventProtocol `json:"protocol"`
R string `json:"r,omitempty"`
W string `json:"w,omitempty"`
RW string `json:"rw,omitempty"`
Meta EventMeta `json:"meta"`
RemoteAddr string `json:"remoteAddress"`
ReceivedAt time.Time `json:"receivedAt"`
}
type EventDNSAnswer ¶
type EventDNSMeta ¶
type EventDNSMeta struct {
Question EventDNSQuestion `json:"question"`
Answer []EventDNSAnswer `json:"answer"`
}
type EventDNSQuestion ¶
type EventFTPData ¶
type EventFTPMeta ¶
type EventFTPMeta struct {
Session EventFTPData `json:"session"`
}
type EventGeoIPASN ¶
type EventGeoIPCountry ¶
type EventGeoIPMeta ¶
type EventGeoIPMeta struct {
City string `json:"city"`
Country EventGeoIPCountry `json:"country"`
Subdivisions []string `json:"subdivisions"`
ASN EventGeoIPASN `json:"asn"`
}
type EventHTTPMeta ¶
type EventHTTPMeta struct {
Request EventHTTPRequest `json:"request"`
Response EventHTTPResponse `json:"response"`
}
type EventHTTPRequest ¶
type EventHTTPResponse ¶
type EventMeta ¶
type EventMeta struct {
DNS *EventDNSMeta `json:"dns,omitempty"`
HTTP *EventHTTPMeta `json:"http,omitempty"`
SMTP *EventSMTPMeta `json:"smtp,omitempty"`
FTP *EventFTPMeta `json:"ftp,omitempty"`
Secure bool `json:"secure"`
GeoIP *EventGeoIPMeta `json:"geoip,omitempty"`
}
type EventProtocol ¶
type EventProtocol string
ENUM(dns, http, https, smtp, ftp)
const ( // EventProtocolDns is a EventProtocol of type dns. EventProtocolDns EventProtocol = "dns" // EventProtocolHttp is a EventProtocol of type http. EventProtocolHttp EventProtocol = "http" // EventProtocolHttps is a EventProtocol of type https. EventProtocolHttps EventProtocol = "https" // EventProtocolSmtp is a EventProtocol of type smtp. EventProtocolSmtp EventProtocol = "smtp" // EventProtocolFtp is a EventProtocol of type ftp. EventProtocolFtp EventProtocol = "ftp" )
func EventProtocolValues ¶
func EventProtocolValues() []EventProtocol
EventProtocolValues returns a list of the values for EventProtocol
func ParseEventProtocol ¶
func ParseEventProtocol(name string) (EventProtocol, error)
ParseEventProtocol attempts to convert a string to a EventProtocol.
func (*EventProtocol) Get ¶
func (x *EventProtocol) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (EventProtocol) IsValid ¶
func (x EventProtocol) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (EventProtocol) Ptr ¶
func (x EventProtocol) Ptr() *EventProtocol
func (*EventProtocol) Set ¶
func (x *EventProtocol) Set(val string) error
Set implements the Golang flag.Value interface func.
func (EventProtocol) String ¶
func (x EventProtocol) String() string
String implements the Stringer interface.
func (*EventProtocol) Type ¶
func (x *EventProtocol) Type() string
Type implements the github.com/spf13/pFlag Value interface.
type EventSMTPAddress ¶
type EventSMTPData ¶
type EventSMTPEmail ¶
type EventSMTPEmail struct {
Subject string `json:"subject"`
From []EventSMTPAddress `json:"from"`
To []EventSMTPAddress `json:"to"`
Cc []EventSMTPAddress `json:"cc"`
Bcc []EventSMTPAddress `json:"bcc"`
Date *time.Time `json:"date,omitempty"`
Text string `json:"text"`
HTML string `json:"html"`
}
type EventSMTPMeta ¶
type EventSMTPMeta struct {
Session EventSMTPData `json:"session"`
Email EventSMTPEmail `json:"email"`
}
type EventsGet ¶
type EventsGet interface {
EventsGet(context.Context, EventsGetInput) (*EventsGetOutput, error)
}
type EventsGetInput ¶
func (EventsGetInput) Validate ¶
func (in EventsGetInput) Validate() v.Problems
type EventsGetOutput ¶
type EventsGetOutput Event
type EventsList ¶
type EventsList interface {
EventsList(context.Context, EventsListInput) (EventsListOutput, error)
}
type EventsListInput ¶
func (EventsListInput) Validate ¶
func (in EventsListInput) Validate() v.Problems
type EventsListOutput ¶
type EventsListOutput []Event
type HTTPMethod ¶
type HTTPMethod string
ENUM(GET, HEAD, POST, PUT, PATCH, DELETE, CONNECT, OPTIONS, TRACE, ANY)
const ( // HTTPMethodGET is a HTTPMethod of type GET. HTTPMethodGET HTTPMethod = "GET" // HTTPMethodHEAD is a HTTPMethod of type HEAD. HTTPMethodHEAD HTTPMethod = "HEAD" // HTTPMethodPOST is a HTTPMethod of type POST. HTTPMethodPOST HTTPMethod = "POST" // HTTPMethodPUT is a HTTPMethod of type PUT. HTTPMethodPUT HTTPMethod = "PUT" // HTTPMethodPATCH is a HTTPMethod of type PATCH. HTTPMethodPATCH HTTPMethod = "PATCH" // HTTPMethodDELETE is a HTTPMethod of type DELETE. HTTPMethodDELETE HTTPMethod = "DELETE" // HTTPMethodCONNECT is a HTTPMethod of type CONNECT. HTTPMethodCONNECT HTTPMethod = "CONNECT" // HTTPMethodOPTIONS is a HTTPMethod of type OPTIONS. HTTPMethodOPTIONS HTTPMethod = "OPTIONS" // HTTPMethodTRACE is a HTTPMethod of type TRACE. HTTPMethodTRACE HTTPMethod = "TRACE" // HTTPMethodANY is a HTTPMethod of type ANY. HTTPMethodANY HTTPMethod = "ANY" )
func HTTPMethodValues ¶
func HTTPMethodValues() []HTTPMethod
HTTPMethodValues returns a list of the values for HTTPMethod
func ParseHTTPMethod ¶
func ParseHTTPMethod(name string) (HTTPMethod, error)
ParseHTTPMethod attempts to convert a string to a HTTPMethod.
func (*HTTPMethod) Get ¶
func (x *HTTPMethod) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (HTTPMethod) IsValid ¶
func (x HTTPMethod) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (HTTPMethod) Ptr ¶
func (x HTTPMethod) Ptr() *HTTPMethod
func (*HTTPMethod) Set ¶
func (x *HTTPMethod) Set(val string) error
Set implements the Golang flag.Value interface func.
func (HTTPMethod) String ¶
func (x HTTPMethod) String() string
String implements the Stringer interface.
func (*HTTPMethod) Type ¶
func (x *HTTPMethod) Type() string
Type implements the github.com/spf13/pFlag Value interface.
type HTTPRoute ¶
type HTTPRoute struct {
Index int64 `json:"index"`
PayloadSubdomain string `json:"payloadSubdomain"`
Method HTTPMethod `json:"method"`
Path string `json:"path"`
Code int `json:"code"`
Headers map[string][]string `json:"headers"`
Body string `json:"body"`
IsDynamic bool `json:"isDynamic"`
CreatedAt time.Time `json:"createdAt"`
}
type HTTPRoutesClear ¶
type HTTPRoutesClear interface {
HTTPRoutesClear(context.Context, HTTPRoutesClearInput) (HTTPRoutesClearOutput, error)
}
type HTTPRoutesClearInput ¶
func (HTTPRoutesClearInput) Validate ¶
func (in HTTPRoutesClearInput) Validate() v.Problems
type HTTPRoutesClearOutput ¶
type HTTPRoutesClearOutput []HTTPRoute
type HTTPRoutesCreate ¶
type HTTPRoutesCreate interface {
HTTPRoutesCreate(context.Context, HTTPRoutesCreateInput) (*HTTPRoutesCreateOutput, error)
}
type HTTPRoutesCreateInput ¶
type HTTPRoutesCreateInput struct {
PayloadName string
Method HTTPMethod
Path string
Code int
Headers map[string][]string
Body string
IsDynamic bool
}
func (HTTPRoutesCreateInput) Validate ¶
func (in HTTPRoutesCreateInput) Validate() v.Problems
type HTTPRoutesCreateOutput ¶
type HTTPRoutesCreateOutput HTTPRoute
type HTTPRoutesDelete ¶
type HTTPRoutesDelete interface {
HTTPRoutesDelete(context.Context, HTTPRoutesDeleteInput) (*HTTPRoutesDeleteOutput, error)
}
type HTTPRoutesDeleteInput ¶
func (HTTPRoutesDeleteInput) Validate ¶
func (in HTTPRoutesDeleteInput) Validate() v.Problems
type HTTPRoutesDeleteOutput ¶
type HTTPRoutesDeleteOutput HTTPRoute
type HTTPRoutesList ¶
type HTTPRoutesList interface {
HTTPRoutesList(context.Context, HTTPRoutesListInput) (HTTPRoutesListOutput, error)
}
type HTTPRoutesListInput ¶
type HTTPRoutesListInput struct {
PayloadName string
}
func (HTTPRoutesListInput) Validate ¶
func (in HTTPRoutesListInput) Validate() v.Problems
type HTTPRoutesListOutput ¶
type HTTPRoutesListOutput []HTTPRoute
type HTTPRoutesUpdate ¶
type HTTPRoutesUpdate interface {
HTTPRoutesUpdate(context.Context, HTTPRoutesUpdateInput) (*HTTPRoutesUpdateOutput, error)
}
type HTTPRoutesUpdateInput ¶
type HTTPRoutesUpdateInput struct {
Payload string
Index int64
Method *HTTPMethod
Path *string
Code *int
Headers map[string][]string
Body *string
IsDynamic *bool
}
func (HTTPRoutesUpdateInput) Validate ¶
func (in HTTPRoutesUpdateInput) Validate() v.Problems
type HTTPRoutesUpdateOutput ¶
type HTTPRoutesUpdateOutput HTTPRoute
type LarkProvisionUser ¶
LarkProvisionUser ensures a user exists for the given Lark ID, creating one on first contact. Lark is self-service: unlike the other messengers, a previously unknown Lark user is provisioned rather than rejected. Callers run it before AuthContextByLarkID, which stays lookup-only.
type PayloadsClear ¶
type PayloadsClear interface {
PayloadsClear(context.Context, PayloadsClearInput) (PayloadsClearOutput, error)
}
type PayloadsClearInput ¶
type PayloadsClearInput struct {
Name string
}
type PayloadsClearOutput ¶
type PayloadsClearOutput []Payload
type PayloadsCreate ¶
type PayloadsCreate interface {
PayloadsCreate(context.Context, PayloadsCreateInput) (*PayloadsCreateOutput, error)
}
type PayloadsCreateInput ¶
type PayloadsCreateInput struct {
Name string
NotifyProtocols []ProtoCategory
StoreEvents bool
}
func (PayloadsCreateInput) Validate ¶
func (in PayloadsCreateInput) Validate() v.Problems
type PayloadsCreateOutput ¶
type PayloadsCreateOutput Payload
type PayloadsDelete ¶
type PayloadsDelete interface {
PayloadsDelete(context.Context, PayloadsDeleteInput) (*PayloadsDeleteOutput, error)
}
type PayloadsDeleteInput ¶
type PayloadsDeleteInput struct {
Name string
}
func (PayloadsDeleteInput) Validate ¶
func (in PayloadsDeleteInput) Validate() v.Problems
type PayloadsDeleteOutput ¶
type PayloadsDeleteOutput Payload
type PayloadsList ¶
type PayloadsList interface {
PayloadsList(context.Context, PayloadsListInput) (PayloadsListOutput, error)
}
type PayloadsListInput ¶
type PayloadsListOutput ¶
type PayloadsListOutput []Payload
type PayloadsUpdate ¶
type PayloadsUpdate interface {
PayloadsUpdate(context.Context, PayloadsUpdateInput) (*PayloadsUpdateOutput, error)
}
type PayloadsUpdateInput ¶
type PayloadsUpdateInput struct {
Name string
NewName string
// Partial update: a nil NotifyProtocols (slice) or StoreEvents (bool needs a
// pointer since false is meaningful) leaves the existing setting unchanged.
NotifyProtocols []ProtoCategory
StoreEvents *bool
}
func (PayloadsUpdateInput) Validate ¶
func (in PayloadsUpdateInput) Validate() v.Problems
type PayloadsUpdateOutput ¶
type PayloadsUpdateOutput Payload
type ProfileGet ¶
type ProfileGet interface {
ProfileGet(context.Context) (*ProfileGetOutput, error)
}
type ProfileGetOutput ¶
type ProfileGetOutput User
type ProtoCategory ¶
type ProtoCategory string
ENUM(dns, http, smtp, ftp)
const ( // ProtoCategoryDns is a ProtoCategory of type dns. ProtoCategoryDns ProtoCategory = "dns" // ProtoCategoryHttp is a ProtoCategory of type http. ProtoCategoryHttp ProtoCategory = "http" // ProtoCategorySmtp is a ProtoCategory of type smtp. ProtoCategorySmtp ProtoCategory = "smtp" // ProtoCategoryFtp is a ProtoCategory of type ftp. ProtoCategoryFtp ProtoCategory = "ftp" )
func ParseProtoCategory ¶
func ParseProtoCategory(name string) (ProtoCategory, error)
ParseProtoCategory attempts to convert a string to a ProtoCategory.
func ProtoCategoryValues ¶
func ProtoCategoryValues() []ProtoCategory
ProtoCategoryValues returns a list of the values for ProtoCategory
func (*ProtoCategory) Get ¶
func (x *ProtoCategory) Get() interface{}
Get implements the Golang flag.Getter interface func.
func (ProtoCategory) IsValid ¶
func (x ProtoCategory) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (ProtoCategory) Ptr ¶
func (x ProtoCategory) Ptr() *ProtoCategory
func (*ProtoCategory) Set ¶
func (x *ProtoCategory) Set(val string) error
Set implements the Golang flag.Value interface func.
func (ProtoCategory) String ¶
func (x ProtoCategory) String() string
String implements the Stringer interface.
func (*ProtoCategory) Type ¶
func (x *ProtoCategory) Type() string
Type implements the github.com/spf13/pFlag Value interface.
type ServerService ¶
type ServerService interface {
Service
AuthContextByAPIToken
AuthContextByTelegramID
AuthContextBySlackID
AuthContextByLarkID
LarkProvisionUser
}
ServerService is the full server-side service: the business operations of Service plus the ability to resolve a caller's identity into an authenticated context. It is implemented by DB-backed services (dbsvc and its decorators); the api-backed client (remotesvc) implements only Service, since identity resolution happens on the server.
type Service ¶
type Service interface {
PayloadsCreate
PayloadsUpdate
PayloadsDelete
PayloadsClear
PayloadsList
UsersCreate
UsersDelete
ProfileGet
EventsList
EventsGet
DNSRecordsCreate
DNSRecordsDelete
DNSRecordsClear
DNSRecordsList
HTTPRoutesCreate
HTTPRoutesUpdate
HTTPRoutesDelete
HTTPRoutesClear
HTTPRoutesList
AuditRecordsList
AuditRecordsGet
}
type UsersCreate ¶
type UsersCreate interface {
UsersCreate(context.Context, UsersCreateInput) (*UsersCreateOutput, error)
}
type UsersCreateInput ¶
type UsersCreateInput struct {
Name string
APIToken *string
TelegramID *int64
LarkID *string
SlackID *string
IsAdmin bool
}
func (UsersCreateInput) Validate ¶
func (in UsersCreateInput) Validate() v.Problems
type UsersCreateOutput ¶
type UsersCreateOutput User
type UsersDelete ¶
type UsersDelete interface {
UsersDelete(context.Context, UsersDeleteInput) (*UsersDeleteOutput, error)
}
type UsersDeleteInput ¶
type UsersDeleteInput struct {
Name string
}
func (UsersDeleteInput) Validate ¶
func (in UsersDeleteInput) Validate() v.Problems
type UsersDeleteOutput ¶
type UsersDeleteOutput User
Source Files
¶
- audit_records_get.go
- audit_records_list.go
- auth.go
- context.go
- dns_records_clear.go
- dns_records_create.go
- dns_records_delete.go
- dns_records_list.go
- error.go
- events_get.go
- events_list.go
- http_routes_clear.go
- http_routes_create.go
- http_routes_delete.go
- http_routes_list.go
- http_routes_update.go
- models.go
- models_enum.go
- payloads_clear.go
- payloads_create.go
- payloads_delete.go
- payloads_list.go
- payloads_update.go
- profile_get.go
- service.go
- users_create.go
- users_delete.go
- validators.go