util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2022 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoardHasAuthType

func BoardHasAuthType(board string, auth string) (bool, error)

func Captcha

func Captcha() string

func ConvertSize

func ConvertSize(size int64) string

func CreateKey

func CreateKey(len int) (string, error)

func CreateNewCaptcha

func CreateNewCaptcha() error

func CreateTripCode

func CreateTripCode(input string) string

func CreateUniqueID

func CreateUniqueID(actor string) (string, error)

func CreatedNeededDirectories

func CreatedNeededDirectories() error

func DeleteCaptchaCode

func DeleteCaptchaCode(verify string) error

func DeleteRegexBlacklist

func DeleteRegexBlacklist(id int) error

func EscapeString

func EscapeString(text string) string

func GetBoardAuth

func GetBoardAuth(board string) ([]string, error)

func GetCaptchaCode

func GetCaptchaCode(verify string) (string, error)

func GetCaptchaTotal

func GetCaptchaTotal() (int, error)

func GetContentType

func GetContentType(location string) string

func GetCookieKey

func GetCookieKey() (string, error)

func GetFileContentType

func GetFileContentType(out multipart.File) (string, error)

func GetPasswordFromSession

func GetPasswordFromSession(ctx *fiber.Ctx) (string, string)

func GetPathProxyType

func GetPathProxyType(path string) string

func GetRandomCaptcha

func GetRandomCaptcha() (string, error)

func GetUniqueFilename

func GetUniqueFilename(ext string) string

GetUniqueFilename will look for an available random filename in the /public/ directory.

func HasAuth

func HasAuth(code string, board string) (bool, string)

func HasAuthCooldown

func HasAuthCooldown(auth string) (bool, error)

func HashBytes

func HashBytes(media []byte) string

func HashMedia

func HashMedia(media string) string

func IsEmailSetup

func IsEmailSetup() bool

func IsInStringArray

func IsInStringArray(haystack []string, needle string) bool

IsInStringArray looks for a string in a string array and returns true if it is found.

func IsOnion

func IsOnion(url string) bool

func IsPostBlacklist

func IsPostBlacklist(comment string) (bool, error)

func LoadThemes

func LoadThemes() error

func LocalShort

func LocalShort(url string) string

func MakeCaptchas

func MakeCaptchas(total int) error

func MakeError

func MakeError(err error, msg string) error

func MediaProxy

func MediaProxy(url string) string

func RandomID

func RandomID(size int) string

func RemoteShort

func RemoteShort(url string) string

func RouteProxy

func RouteProxy(req *http.Request) (*http.Response, error)

func ShortImg

func ShortImg(url string) string

func ShortURL

func ShortURL(actorName string, url string) string

func StripTransferProtocol

func StripTransferProtocol(value string) string

func VerficationCooldown

func VerficationCooldown() error

func VerficationCooldownRemove

func VerficationCooldownRemove() error

func WriteRegexBlacklist

func WriteRegexBlacklist(regex string) error

Types

type PostBlacklist

type PostBlacklist struct {
	Id    int
	Regex string
}

func GetRegexBlacklist

func GetRegexBlacklist() ([]PostBlacklist, error)

type Signature

type Signature struct {
	KeyId     string
	Headers   []string
	Signature string
	Algorithm string
}

type Verify

type Verify struct {
	Type       string
	Identifier string
	Code       string
	Created    string
	Board      string
	Label      string
}

func GetVerificationByCode

func GetVerificationByCode(code string) (Verify, error)

func GetVerificationByEmail

func GetVerificationByEmail(email string) (Verify, error)

func GetVerify

func GetVerify(access string) (Verify, error)

func (Verify) Create

func (verify Verify) Create() error

func (Verify) CreateBoardAccess

func (verify Verify) CreateBoardAccess() error

func (Verify) CreateBoardMod

func (verify Verify) CreateBoardMod() error

func (Verify) DeleteBoardMod

func (verify Verify) DeleteBoardMod() error

func (Verify) GetBoardMod

func (verify Verify) GetBoardMod() (Verify, error)

func (Verify) GetCode

func (verify Verify) GetCode() (Verify, error)

func (Verify) HasBoardAccess

func (verify Verify) HasBoardAccess() (bool, string)

func (Verify) SendVerification

func (verify Verify) SendVerification() error

func (Verify) VerifyCooldownAdd

func (verify Verify) VerifyCooldownAdd() error

type VerifyCooldown

type VerifyCooldown struct {
	Identifier string
	Code       string
	Time       int
}

func VerifyCooldownCurrent

func VerifyCooldownCurrent(auth string) (VerifyCooldown, error)

Jump to

Keyboard shortcuts

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