controller

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Endpoints = map[string]*Endpoint{
	getEndpointKey(atlassianConnectJSON):    atlassianConnectJSON,
	getEndpointKey(confluenceCloudWebhook):  confluenceCloudWebhook,
	getEndpointKey(saveChannelSubscription): saveChannelSubscription,
	getEndpointKey(editChannelSubscription): editChannelSubscription,
	getEndpointKey(confluenceServerWebhook): confluenceServerWebhook,
	getEndpointKey(getChannelSubscription):  getChannelSubscription,

	getEndpointKey(autocompleteGetChannelSubscriptions): autocompleteGetChannelSubscriptions,
}

Endpoints is a map of endpoint key to endpoint object Usage: getEndpointKey(GetMetadata): GetMetadata

Functions

func InitAPI

func InitAPI() *mux.Router

InitAPI initializes the REST API

func IsAdmin added in v1.2.0

func IsAdmin(w http.ResponseWriter, r *http.Request) bool

IsAdmin verifies if provided request is performed by a logged-in Mattermost user.

func ReturnStatusOK

func ReturnStatusOK(w io.Writer)

Types

type Endpoint

type Endpoint struct {
	Path          string
	Method        string
	Execute       func(w http.ResponseWriter, r *http.Request)
	RequiresAdmin bool
}

Jump to

Keyboard shortcuts

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