utils

package
v0.0.0-...-4f48353 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JWTSecret = []byte("!!SECRET!!")

Functions

func GenerateJWT

func GenerateJWT(id uint) string

func HttpConnectionStatus

func HttpConnectionStatus(cfg *Conf) (bool, error)

func UserListHttpHandler

func UserListHttpHandler(cfg *Conf) (error, bool, []byte)

Types

type Conf

type Conf struct {
	UsersURI string `mapstructure:"usersURI"`
}

type Data

type Data struct {
	Login             string `json:"login"`
	ID                int    `json:"id"`
	NodeID            string `json:"node_id"`
	AvatarURL         string `json:"avatar_url"`
	GravatarID        string `json:"gravatar_id"`
	URL               string `json:"url"`
	HTMLURL           string `json:"html_url"`
	FollowersURL      string `json:"followers_url"`
	FollowingURL      string `json:"following_url"`
	GistsURL          string `json:"gists_url"`
	StarredURL        string `json:"starred_url"`
	SubscriptionsURL  string `json:"subscriptions_url"`
	OrganizationsURL  string `json:"organizations_url"`
	ReposURL          string `json:"repos_url"`
	EventsURL         string `json:"events_url"`
	ReceivedEventsURL string `json:"received_events_url"`
	Type              string `json:"type"`
	SiteAdmin         bool   `json:"site_admin"`
}

type Error

type Error struct {
	Errors map[string]interface{} `json:"errors"`
}

func AccessForbidden

func AccessForbidden() Error

func NewError

func NewError(err error) Error

NewError add switch other variant

func NewValidatorError

func NewValidatorError(err error) Error

func NotFound

func NotFound() Error

type UserResponseData

type UserResponseData struct {
	Data []*Data `json:"data"`
}

Jump to

Keyboard shortcuts

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