handler

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package handler provides handlers of Graylog API mock server. Basically enduser does not use the package directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleAddUserToRole

func HandleAddUserToRole(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleAddUserToRole is the handler of Add a user to a role API.

func HandleCreateIndexSet

func HandleCreateIndexSet(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleCreateIndexSet is the handler of Create an Index Set API.

func HandleCreateInput

func HandleCreateInput(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleCreateInput is the handler of Create an Input API.

func HandleCreateRole

func HandleCreateRole(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleCreateRole is the handler of Create Role API.

func HandleCreateStream

func HandleCreateStream(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleCreateStream is the handler of Create a Stream API.

func HandleCreateStreamRule

func HandleCreateStreamRule(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleCreateStreamRule is the handler of Create a Stream Rule API.

func HandleCreateUser

func HandleCreateUser(
	u *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleCreateUser is the handler of Create User API.

func HandleDeleteIndexSet

func HandleDeleteIndexSet(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleDeleteIndexSet is the handler of Delete an Index Set API.

func HandleDeleteInput

func HandleDeleteInput(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleDeleteInput is the handler of Delete an Input API.

func HandleDeleteRole

func HandleDeleteRole(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleDeleteRole is the handler of Delete Role API.

func HandleDeleteStream

func HandleDeleteStream(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleDeleteStream is the handler of Delete a Stream API.

func HandleDeleteStreamRule

func HandleDeleteStreamRule(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleDeleteStreamRule is the handler of Delete a Stream Rule API.

func HandleDeleteUser

func HandleDeleteUser(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleDeleteUser is the handler of Delete User API.

func HandleGetAlertConditions added in v0.2.0

func HandleGetAlertConditions(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleGetAlertConditions is the handler of GET Alert Conditions API.

func HandleGetEnabledStreams

func HandleGetEnabledStreams(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleGetEnabledStreams is the handler of Get all enabled streams API.

func HandleGetIndexSet

func HandleGetIndexSet(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleGetIndexSet is the handler of Get an Index Set API.

func HandleGetIndexSetStats

func HandleGetIndexSetStats(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleGetIndexSetStats is the handler of Get Index Set Statistics API.

func HandleGetIndexSets

func HandleGetIndexSets(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleGetIndexSets is the handler of Get Index Sets API.

func HandleGetInput

func HandleGetInput(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleGetInput is the handler of Get an Input API.

func HandleGetInputs

func HandleGetInputs(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleGetInputs is the handler of Get Inputs API.

func HandleGetRole

func HandleGetRole(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleGetRole is the handler of GET Role API.

func HandleGetRoles

func HandleGetRoles(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleGetRoles is the handler of GET Roles API.

func HandleGetStream

func HandleGetStream(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleGetStream is the handler of Get a Stream API.

func HandleGetStreamRule

func HandleGetStreamRule(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleGetStreamRule is the handler of Get a Stream Rule API.

func HandleGetStreamRules

func HandleGetStreamRules(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleGetStreamRules is the handler of Get Stream Rules API.

func HandleGetStreams

func HandleGetStreams(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleGetStreams is the handler of Get Streams API.

func HandleGetTotalIndexSetStats

func HandleGetTotalIndexSetStats(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleGetTotalIndexSetStats is the handler of Get Index Set Statistics of all Index Sets API.

func HandleGetUser

func HandleGetUser(
	u *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleGetUser is the handler of GET User API.

func HandleGetUsers

func HandleGetUsers(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, _ httprouter.Params,
) (interface{}, int, error)

HandleGetUsers is the handler of GET Users API.

func HandleNotFound

func HandleNotFound(lgc *logic.Logic) http.HandlerFunc

HandleNotFound is the generator of the NotFound handler.

func HandlePauseStream

func HandlePauseStream(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandlePauseStream is the handler of Pause a Stream API.

func HandleRemoveUserFromRole

func HandleRemoveUserFromRole(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleRemoveUserFromRole is the handler of Remove a user from a role API.

func HandleResumeStream

func HandleResumeStream(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleResumeStream is the handler of Resume a Stream API.

func HandleRoleMembers

func HandleRoleMembers(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleRoleMembers is the handler of Get the role's members API.

func HandleSetDefaultIndexSet

func HandleSetDefaultIndexSet(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleSetDefaultIndexSet is the handler of Set the default Index Set API.

func HandleUpdateIndexSet

func HandleUpdateIndexSet(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleUpdateIndexSet is the handler of Update an Index Set API.

func HandleUpdateInput

func HandleUpdateInput(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleUpdateInput is the handler of Update an Input API.

func HandleUpdateRole

func HandleUpdateRole(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleUpdateRole is the handler of Update Role API.

func HandleUpdateStream

func HandleUpdateStream(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleUpdateStream is the handler of Update a Stream API.

func HandleUpdateStreamRule

func HandleUpdateStreamRule(
	user *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleUpdateStreamRule is the handler of Update a Stream Rule API.

func HandleUpdateUser

func HandleUpdateUser(
	u *graylog.User, lgc *logic.Logic,
	w http.ResponseWriter, r *http.Request, ps httprouter.Params,
) (interface{}, int, error)

HandleUpdateUser is the handler of Update User API.

func NewRouter

func NewRouter(lgc *logic.Logic) *httprouter.Router

NewRouter returns a new HTTP router.

Types

type APIError

type APIError struct {
	Type    string `json:"type"`
	Message string `json:"message"`
}

APIError represents a Graylog API's error response body.

func NewAPIError

func NewAPIError(msg string) *APIError

NewAPIError returns a new APIError.

type Handler

type Handler func(user *graylog.User, lgc *logic.Logic, w http.ResponseWriter, r *http.Request, ps httprouter.Params) (interface{}, int, error)

Handler is the graylog REST API's handler. the argument `user` is the authenticated user and are mainly used for the authorization.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL