Documentation ¶
Index ¶
- Constants
- type BaseHandler
- func (handler *BaseHandler) GetPathParameter(path string, paramIndex int) string
- func (handler *BaseHandler) Handle(responseWriter http.ResponseWriter, request *http.Request)
- func (handler *BaseHandler) ReadJson(request *http.Request, obj interface{}) error
- func (handler *BaseHandler) WriteJson(responseWriter http.ResponseWriter, request *http.Request, statusCode int, ...) (int, error)
- type BasePreprocessor
- type Client
- func (client *Client) FormatUrl(url string, path string) string
- func (client *Client) MockResponse(mockResponse *http.Response, mockError error)
- func (client *Client) MockStringResponse(body string, statusCode int, mockError error)
- func (client *Client) SendAuthorizedObject(method string, path string, obj interface{}, returnedObj interface{}) (bool, error)
- func (client *Client) SendAuthorizedRequest(method string, path string, contentType string, reader io.Reader) (*http.Response, error)
- func (client *Client) SendObject(method string, path string, obj interface{}, returnedObj interface{}, ...) (bool, error)
- func (client *Client) SendRequest(method string, path string, contentType string, reader io.Reader, auth bool) (*http.Response, error)
- type ClientAuth
- type Connection
- type ContextKey
- type HandlerImpl
- type Host
- func (host *Host) AddConnection(wsConn *websocket.Conn, ip string) *Connection
- func (host *Host) AddPreprocessor(preprocessor Preprocessor) error
- func (host *Host) Broadcast(kind string, obj interface{})
- func (host *Host) GetSourceIp(request *http.Request) string
- func (host *Host) IsRunning() bool
- func (host *Host) Preprocess(ctx context.Context, req *http.Request) (context.Context, int, error)
- func (host *Host) Preprocessors() []Preprocessor
- func (host *Host) Register(route string, handler HostHandler)
- func (host *Host) RemoveConnection(wsConn *websocket.Conn)
- func (host *Host) Start()
- func (host *Host) Stop()
- type HostHandler
- type Preprocessor
- type WebSocketHandler
- type WebSocketMessage
Constants ¶
View Source
const ContextKeyRequestId = ContextKey("ContextKeyRequestId")
View Source
const ContextKeyRequestor = ContextKey("ContextKeyRequestor")
View Source
const ContextKeyRequestorId = ContextKey("ContextKeyRequestorId")
View Source
const GENERIC_ERROR_MESSAGE = "The request could not be processed. Contact a server admin for assistance with reviewing error details in SOC logs."
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseHandler ¶
type BaseHandler struct { Host *Host Impl HandlerImpl }
func (*BaseHandler) GetPathParameter ¶
func (handler *BaseHandler) GetPathParameter(path string, paramIndex int) string
func (*BaseHandler) Handle ¶
func (handler *BaseHandler) Handle(responseWriter http.ResponseWriter, request *http.Request)
func (*BaseHandler) ReadJson ¶
func (handler *BaseHandler) ReadJson(request *http.Request, obj interface{}) error
func (*BaseHandler) WriteJson ¶
func (handler *BaseHandler) WriteJson(responseWriter http.ResponseWriter, request *http.Request, statusCode int, obj interface{}) (int, error)
type BasePreprocessor ¶
type BasePreprocessor struct { }
func NewBasePreprocessor ¶
func NewBasePreprocessor() *BasePreprocessor
func (*BasePreprocessor) Preprocess ¶
func (*BasePreprocessor) PreprocessPriority ¶
func (Processor *BasePreprocessor) PreprocessPriority() int
type Client ¶
type Client struct { Auth ClientAuth // contains filtered or unexported fields }
func (*Client) MockResponse ¶
func (*Client) MockStringResponse ¶
func (*Client) SendAuthorizedObject ¶
func (*Client) SendAuthorizedRequest ¶
func (*Client) SendObject ¶
type ClientAuth ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func NewConnection ¶
func NewConnection(wsConn *websocket.Conn, ip string) *Connection
func (*Connection) IsAuthorized ¶
func (connection *Connection) IsAuthorized(kind string) bool
func (*Connection) UpdatePingTime ¶
func (connection *Connection) UpdatePingTime()
type ContextKey ¶
type ContextKey string
type HandlerImpl ¶
type Host ¶
type Host struct { Version string // contains filtered or unexported fields }
func (*Host) AddConnection ¶
func (host *Host) AddConnection(wsConn *websocket.Conn, ip string) *Connection
func (*Host) AddPreprocessor ¶
func (host *Host) AddPreprocessor(preprocessor Preprocessor) error
func (*Host) Preprocess ¶
func (*Host) Preprocessors ¶
func (host *Host) Preprocessors() []Preprocessor
*
- Returns a copy of the list of preprocessors, in their current priority order,
- where the first preprocessor at index 0 is processed first.
func (*Host) Register ¶
func (host *Host) Register(route string, handler HostHandler)
func (*Host) RemoveConnection ¶
type HostHandler ¶
type HostHandler interface {
Handle(responseWriter http.ResponseWriter, request *http.Request)
}
type Preprocessor ¶
type WebSocketHandler ¶
type WebSocketHandler struct {
BaseHandler
}
func NewWebSocketHandler ¶
func NewWebSocketHandler(host *Host) *WebSocketHandler
type WebSocketMessage ¶
type WebSocketMessage struct { Kind string Object interface{} }
Click to show internal directories.
Click to hide internal directories.