handler

package
v2.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 25, 2019 License: MIT Imports: 12 Imported by: 4

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, r *http.Request, ps Params,
) (interface{}, int, error)

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

func HandleCreateCollectorConfiguration added in v0.7.0

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

HandleCreateCollectorConfiguration is the handler of Create an CollectorConfiguration API.

func HandleCreateCollectorConfigurationInput added in v0.7.0

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

HandleCreateCollectorConfigurationInput is the handler of Create a CollectorConfiguration Input API.

func HandleCreateCollectorConfigurationOutput added in v0.7.0

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

HandleCreateCollectorConfigurationOutput is the handler of Create a CollectorConfiguration Output API.

func HandleCreateCollectorConfigurationSnippet added in v0.7.0

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

HandleCreateCollectorConfigurationSnippet is the handler of Create a CollectorConfiguration Snippet API.

func HandleCreateDashboard added in v0.4.0

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

HandleCreateDashboard is the handler of Create an Dashboard API.

func HandleCreateIndexSet

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

HandleCreateIndexSet is the handler of Create an Index Set API.

func HandleCreateInput

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

HandleCreateInput is the handler of Create an Input API.

func HandleCreateRole

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

HandleCreateRole is the handler of Create Role API.

func HandleCreateStream

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

HandleCreateStream is the handler of Create a Stream API.

func HandleCreateStreamRule

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

HandleCreateStreamRule is the handler of Create a Stream Rule API.

func HandleCreateUser

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

HandleCreateUser is the handler of Create User API.

func HandleDeleteCollectorConfiguration added in v0.7.0

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

HandleDeleteCollectorConfiguration is the handler of Delete an CollectorConfiguration API.

func HandleDeleteCollectorConfigurationInput added in v0.7.0

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

HandleDeleteCollectorConfigurationInput is the handler of Delete an CollectorConfiguration Input API.

func HandleDeleteCollectorConfigurationOutput added in v0.7.0

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

HandleDeleteCollectorConfigurationOutput is the handler of Delete an CollectorConfiguration Output API.

func HandleDeleteCollectorConfigurationSnippet added in v0.7.0

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

HandleDeleteCollectorConfigurationSnippet is the handler of Delete an CollectorConfiguration Snippet API.

func HandleDeleteDashboard added in v0.4.0

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

HandleDeleteDashboard is the handler of Delete an Dashboard API.

func HandleDeleteIndexSet

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

HandleDeleteIndexSet is the handler of Delete an Index Set API.

func HandleDeleteInput

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

HandleDeleteInput is the handler of Delete an Input API.

func HandleDeleteLDAPSetting added in v0.6.0

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

HandleDeleteLDAPSetting is the handler of Delete LDAP Setting API.

func HandleDeleteRole

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

HandleDeleteRole is the handler of Delete Role API.

func HandleDeleteStream

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

HandleDeleteStream is the handler of Delete a Stream API.

func HandleDeleteStreamRule

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

HandleDeleteStreamRule is the handler of Delete a Stream Rule API.

func HandleDeleteUser

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

HandleDeleteUser is the handler of Delete User API.

func HandleGetAlarmCallbacks added in v0.5.0

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

HandleGetAlarmCallbacks is the handler of GET AlarmCallbacks API.

func HandleGetAlert added in v0.3.0

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

HandleGetAlert is the handler of Get an Alert API.

func HandleGetAlertConditions added in v0.2.0

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

HandleGetAlertConditions is the handler of GET Alert Conditions API.

func HandleGetAlerts added in v0.3.0

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

HandleGetAlerts is the handler of GET Alerts API.

func HandleGetCollectorConfiguration added in v0.7.0

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

HandleGetCollectorConfiguration is the handler of Get an CollectorConfiguration API.

func HandleGetCollectorConfigurations added in v0.7.0

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

HandleGetCollectorConfigurations is the handler of Get Collector Configurations API.

func HandleGetDashboard added in v0.4.0

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

HandleGetDashboard is the handler of Get an Dashboard API.

func HandleGetDashboards added in v0.4.0

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

HandleGetDashboards is the handler of Get Dashboards API.

func HandleGetEnabledStreams

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

HandleGetEnabledStreams is the handler of Get all enabled streams API.

func HandleGetIndexSet

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

HandleGetIndexSet is the handler of Get an Index Set API.

func HandleGetIndexSetStats

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

HandleGetIndexSetStats is the handler of Get Index Set Statistics API.

func HandleGetIndexSets

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

HandleGetIndexSets is the handler of Get Index Sets API.

func HandleGetInput

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

HandleGetInput is the handler of Get an Input API.

func HandleGetInputs

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

HandleGetInputs is the handler of Get Inputs API.

func HandleGetLDAPSetting added in v0.6.0

func HandleGetLDAPSetting(
	user *graylog.User, lgc *logic.Logic, _ *http.Request, _ Params,
) (interface{}, int, error)

HandleGetLDAPSetting is the handler of GET LDAP Setting API.

func HandleGetRole

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

HandleGetRole is the handler of GET Role API.

func HandleGetRoles

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

HandleGetRoles is the handler of GET Roles API.

func HandleGetStream

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

HandleGetStream is the handler of Get a Stream API.

func HandleGetStreamRule

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

HandleGetStreamRule is the handler of Get a Stream Rule API.

func HandleGetStreamRules

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

HandleGetStreamRules is the handler of Get Stream Rules API.

func HandleGetStreams

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

HandleGetStreams is the handler of Get Streams API.

func HandleGetTotalIndexSetStats

func HandleGetTotalIndexSetStats(
	user *graylog.User, lgc *logic.Logic, r *http.Request, ps 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, r *http.Request, ps Params,
) (interface{}, int, error)

HandleGetUser is the handler of GET User API.

func HandleGetUsers

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

HandleGetUsers is the handler of GET Users API.

func HandleNotFound

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

HandleNotFound is the generator of the NotFound handler.

func HandlePauseStream

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

HandlePauseStream is the handler of Pause a Stream API.

func HandleRemoveUserFromRole

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

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

func HandleRenameCollectorConfiguration added in v0.7.0

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

HandleRenameCollectorConfiguration is the handler of Rename a CollectorConfiguration API.

func HandleResumeStream

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

HandleResumeStream is the handler of Resume a Stream API.

func HandleRoleMembers

func HandleRoleMembers(
	user *graylog.User, lgc *logic.Logic, r *http.Request, ps 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, r *http.Request, ps Params,
) (interface{}, int, error)

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

func HandleUpdateCollectorConfigurationInput added in v0.7.0

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

HandleUpdateCollectorConfigurationInput is the handler of Update a CollectorConfiguration Input API.

func HandleUpdateCollectorConfigurationOutput added in v0.7.0

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

HandleUpdateCollectorConfigurationOutput is the handler of Update a CollectorConfiguration Output API.

func HandleUpdateCollectorConfigurationSnippet added in v0.7.0

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

HandleUpdateCollectorConfigurationSnippet is the handler of Update a CollectorConfiguration Snippet API.

func HandleUpdateDashboard added in v0.4.0

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

HandleUpdateDashboard is the handler of Update an Dashboard API.

func HandleUpdateIndexSet

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

HandleUpdateIndexSet is the handler of Update an Index Set API.

func HandleUpdateInput

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

HandleUpdateInput is the handler of Update an Input API.

func HandleUpdateLDAPSetting added in v0.6.0

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

HandleUpdateLDAPSetting is the handler of Update LDAPSetting API.

func HandleUpdateRole

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

HandleUpdateRole is the handler of Update Role API.

func HandleUpdateStream

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

HandleUpdateStream is the handler of Update a Stream API.

func HandleUpdateStreamRule

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

HandleUpdateStreamRule is the handler of Update a Stream Rule API.

func HandleUpdateUser

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

HandleUpdateUser is the handler of Update User API.

func NewRouter

func NewRouter(lgc *logic.Logic) http.Handler

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, r *http.Request, ps 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.

type Params added in v0.3.0

type Params interface {
	PathParam(name string) string
	QueryParam(name string) string
}

Params is an interface of request parameters.

func NewEchoParams added in v0.3.0

func NewEchoParams(c echo.Context) Params

NewEchoParams returns a Params.

func NewParams added in v0.3.0

func NewParams(c echo.Context) Params

NewParams returns a Params.

Jump to

Keyboard shortcuts

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