helpers

package
v0.0.0-...-81acb82 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BodyDecode

func BodyDecode(r *http.Request, value interface{}) *errors.VironError

func GenAuthorizationCookie

func GenAuthorizationCookie(token string, opts *http.Cookie) *http.Cookie

GenAuthorizationCookie 認証cookie生成

func GenCookie

func GenCookie(key string, value string, opts *http.Cookie) *http.Cookie

GenCookie cookie生成

func GenOAuthStateCookie

func GenOAuthStateCookie(state string, opts *http.Cookie) *http.Cookie

GenOAuthStateCookie cookie生成

func GenSalt

func GenSalt(size int) string

func GetCookieToken

func GetCookieToken(r *http.Request) (string, error)

GetCookieToken cookieから認証token取得

func MethodNameLower

func MethodNameLower(method string) string

func MethodNameUpper

func MethodNameUpper(method string) string

func OasMerge

func OasMerge(dist *openapi3.T, src *openapi3.T) error

func Ref

func Ref(docRoot *openapi3.T, org string, rep string) error

func Send

func Send(w http.ResponseWriter, code int, send interface{})

func SendError

func SendError(w http.ResponseWriter, code int, err error)

func String2Hash

func String2Hash(str string, salt string, size int, iterations int) string

String2Hash saltを使ってstringをハッシュ化

func UnixToTime

func UnixToTime(unixTime int) time.Time

func UpperCamelToLowerCamel

func UpperCamelToLowerCamel(operationID string) string

func VerifyPassword

func VerifyPassword(input string, hashed string, salt string) bool

VerifyPassword passwordを検証する

Types

type Extensions

type Extensions struct {
	XPages     []*XPage       `json:"x-pages"`
	XTable     *XTable        `json:"x-table"`
	XComplete  *XAutoComplete `json:"x-autocomplete"`
	XTheme     string         `json:"x-theme"`
	XThumbnail string         `json:"x-thumbnail"`
	XTags      []string       `json:"x-tags"`
}

func ConvertExtentions

func ConvertExtentions(apiDef *openapi3.T) *Extensions

type Password

type Password struct {
	Password string
	Salt     string
}

func GenPassword

func GenPassword(password string, salt string) *Password

GenPassword passwordをハッシュ化

type StringSlice

type StringSlice []string

func (StringSlice) Contains

func (s StringSlice) Contains(value string) bool

type XAutoComplete

type XAutoComplete struct {
	ResponseLabelKey string `json:"responseLabelKey"`
	ResponseValueKey string `json:"responseValueKey"`
}

type XContent

type XContent struct {
	OperationID string   `json:"operationId"`
	ResourceID  string   `json:"resourceId"`
	Query       []string `json:"query,omitempty"`
	ContentType string   `json:"type"`
	Pagination  bool     `json:"pagination"`
	Sort        []string `json:"sort,omitempty"`
}

type XPage

type XPage struct {
	ID          string      `json:"id"`
	Group       string      `json:"group"`
	Title       string      `json:"title"`
	Description string      `json:"description"`
	Contents    []*XContent `json:"contents"`
}

type XTable

type XTable struct {
	ResponseListKey string      `json:"responseListKey"`
	Pager           interface{} `json:"pager"`
	Sort            interface{} `json:"sort"`
}

Jump to

Keyboard shortcuts

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