util

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxReqContentLen = 1024 * 1024 * 5
	MaxTwitterLen    = 280
)

Variables

View Source
var (
	Version             string
	Commit              string
	BuildTime           string
	ErrSignInvalid      = errors.New("invalid signature")
	ErrSignNoAddr       = errors.New("no public address found")
	ErrSignNotMatch     = errors.New("signature address not match")
	ErrHttpEmptyRequest = errors.New("empty http post")
)

Functions

func ConvertLongTweetToImg

func ConvertLongTweetToImg(txt string, f *truetype.Font, fontSize float64) (image.Image, error)

func DecryptRandomData

func DecryptRandomData(encryptedData string, passphrase []byte) (*big.Int, error)

func GenerateRandomData

func GenerateRandomData(passphrase []byte) (string, []byte, error)

func IsOverTwitterLimit

func IsOverTwitterLimit(text string) bool

func LogInst

func LogInst() *zerolog.Logger

func ParseTemplates

func ParseTemplates(path string) *template.Template

func RandomBytesInHex

func RandomBytesInHex(count int) string

func ReadRequest

func ReadRequest(request *http.Request, obj any) error

func SetLogLevel

func SetLogLevel(ll string)

func SplitIntoChunks

func SplitIntoChunks(text string, chunkSize int) []string

func TruncateString

func TruncateString(raw, append string) string

func Verify

func Verify(address, message, signedMessage string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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