handler

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateKey added in v0.1.0

func ValidateKey(key string) bool

ValidateKey validates a key against the required format

func ValidateKeyPath added in v1.1.0

func ValidateKeyPath(key string) bool

ValidateKeyPath validates a key with optional parameters

Types

type Handler

type Handler struct{}

Handler ...

func (*Handler) AuthInit

func (h *Handler) AuthInit(e *echo.Echo)

AuthInit initialize authentication

func (*Handler) CreateUrl

func (h *Handler) CreateUrl(c echo.Context) error

func (*Handler) GetURL added in v0.1.0

func (h *Handler) GetURL(c echo.Context) error

GetURL finds an exact matching url if it exists

func (*Handler) IPRestrict added in v0.2.0

func (h *Handler) IPRestrict(next echo.HandlerFunc) echo.HandlerFunc

IPRestrict middleware will allow whitelisted ips through and handle auth

func (*Handler) Opensearch added in v0.1.0

func (h *Handler) Opensearch(c echo.Context) error

Opensearch renders opensearch.xml page to tell the browser where to access search urls

func (*Handler) Popular

func (h *Handler) Popular(c echo.Context) error

Popular finds URLs with the most views

func (*Handler) Search

func (h *Handler) Search(c echo.Context) error

Search finds urls that are similar to the search query param q

func (*Handler) SearchSuggestions

func (h *Handler) SearchSuggestions(c echo.Context) error

SearchSuggestions returns suggestions in the opensearch expected format This allows browsers to auto suggest results from the url bar Format ["searchterm", [array of suggestoins]]

func (*Handler) SlackCommand added in v0.1.0

func (h *Handler) SlackCommand(c echo.Context) error

SlackCommand responds to slack go command

func (*Handler) UpdateUrl

func (h *Handler) UpdateUrl(c echo.Context) error

func (*Handler) Url

func (h *Handler) Url(c echo.Context) (err error)

Url is the handler function for finding a url It will redirect the user to the desired url if one exists

type SlackAttachment added in v0.1.0

type SlackAttachment struct {
	Title  string `json:"title"`
	Text   string `json:"text"`
	Author string `json:"author_text"`
	Footer string `json:"footer"`
}

type SlackPayload added in v0.1.0

type SlackPayload struct {
	Token          string `form:"token"`
	TeamID         string `form:"team_id"`
	TeamDomain     string `form:"team_domain"`
	EnterpriseID   string `form:"enterprise_id"`
	EnterpriseName string `form:"enterprise_name"`
	ChannelID      string `form:"channel_id"`
	ChannelName    string `form:"channel_name"`
	UserID         string `form:"user_id"`
	UserName       string `form:"user_name"`
	Command        string `form:"command"`
	Text           string `form:"text"`
	ResponseURL    string `form:"response_url"`
	TriggerID      string `form:"trigger_id"`
}

SlackPayload received from slack

type SlackResponse added in v0.1.0

type SlackResponse struct {
	ResponseType string            `json:"response_type"`
	Text         string            `json:"text"`
	Attachments  []SlackAttachment `json:"attachments"`
	Parse        string            `json:"parse"`
}

type SlackSecretsVerifier added in v0.1.0

type SlackSecretsVerifier struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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