utils

package
v0.0.0-...-80a4a0d Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeUrlParam

func DecodeUrlParam(param string) (string, error)

Types

type BuiltinUtilities

type BuiltinUtilities struct {
	Strings Strings
	Crypto  Crypto
	Modfile Modfile
}

type Crypto

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

func (Crypto) EncryptString

func (_ Crypto) EncryptString(plaintext string, key string) (string, error)

func (Crypto) EncryptWithAppKey

func (u Crypto) EncryptWithAppKey(plaintext string) (string, error)

func (Crypto) HashPassword

func (_ Crypto) HashPassword(password string) (string, error)

func (Crypto) VerifyPassword

func (_ Crypto) VerifyPassword(password string, hash string) bool

type ErrorResponse

type ErrorResponse struct {
	FailedField string `json:"failed_field"`
	Tag         string `json:"tag"`
	Value       string `json:"value"`
}

type HttpResponse

type HttpResponse struct {
	Success bool        `json:"success"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

HttpResponse ---

This is the recommended way to return a response from the framework It is a struct that contains the status code, message and data For failed responses, the data field can be empty

type Modfile

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

func (Modfile) GetModuleName

func (m Modfile) GetModuleName() string

type PlaceholderReplacer

type PlaceholderReplacer struct {
	Find      string
	ReplaceTo string
}

type Strings

type Strings struct{}

func (Strings) Random

func (_ Strings) Random(number int) string

func (Strings) Replace

func (_ Strings) Replace(haystack string, needles []PlaceholderReplacer) string

Jump to

Keyboard shortcuts

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