approval

package
v0.0.0-...-1d4b6c7 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORSEnabledFunction

func CORSEnabledFunction(w http.ResponseWriter, r *http.Request)

Types

type Approval

type Approval struct {
	ID     string `json:"id"`
	Name   string `json:"name"`
	URL    string `json:"url"`
	Status Status `json:"status"`
}

func Add

func Add(name, url string, status Status) Approval

func Get

func Get(id string) *Approval

func List

func List() []Approval

func Update

func Update(id string, a Approval) Approval

type Handler

type Handler struct{}

func NewHTTPHandler

func NewHTTPHandler() *Handler

func (*Handler) Add

func (h *Handler) Add(w http.ResponseWriter, req *http.Request)

func (*Handler) Get

func (h *Handler) Get(w http.ResponseWriter, req *http.Request)

func (*Handler) List

func (h *Handler) List(w http.ResponseWriter, req *http.Request)

func (*Handler) Options

func (h *Handler) Options(w http.ResponseWriter, req *http.Request)

func (*Handler) Update

func (h *Handler) Update(url string) func(http.ResponseWriter, *http.Request)

type Status

type Status string
var (
	StatusUnknown  Status = "Unknown"
	StatusDenied   Status = "Denied"
	StatusApproved Status = "Approved"
)

Jump to

Keyboard shortcuts

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