chefapi_lib

package module
v0.0.0-...-992f98f Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

chefapi_lib

Common functions used by the other chefapi go modules.

import 'github.com/MarkGibbons/chefapi_lib'

Documentation

Overview

Shared structures and common routines

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllOrgs

func AllOrgs() (orgNames []string, err error)

AllOrgs returns a list of all of the organizations

func ChefStatus

func ChefStatus(in_err error) (message string, statusCode int)

StdMessageStatus extracts the status code from a go-chef api error message

func CleanInput

func CleanInput(vars map[string]string) (err error)

Verify the input characters are allowed

func InputError

func InputError(w *http.ResponseWriter)

InputError sets an error message for invalid values in the url

func LoggedIn

func LoggedIn(r *http.Request) (user string, code int)

LoggedIn verifies the JWT and extracts the user name

Types

type Auth

type Auth struct {
	Auth  bool   `json:"auth"`
	Group string `json:"group"`
	Node  string `json:"node"`
	Org   string `json:"org"`
	User  string `json:"user"`
}

Auth is the structure returned to indicate access allowed or not

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

Jump to

Keyboard shortcuts

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