serve

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MiByte = 1 << 20
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(content string, decryptedKey string) (string, error)

func Encrypt

func Encrypt(content string, decryptedKey string) (string, error)

func Language

func Language(r *http.Request) string

func NewExpandReader

func NewExpandReader(file string, expandEnv bool) (io.ReadCloser, error)

func ParseLangEnv added in v0.17.0

func ParseLangEnv(langEnv string) string

func RegisterLanguageMatcher

func RegisterLanguageMatcher() error

func Translate added in v0.17.0

func Translate(langKey, text string) string

func W

func W(r *http.Request, message string) string

Types

type Cache

type Cache struct {
	NumCounters int64 `toml:"num_counters"`
	MaxCost     int64 `toml:"max_cost"`
	BufferItems int64 `toml:"buffer_items"`
}

type Database

type Database struct {
	Name    string   `toml:"name"`
	User    string   `toml:"user"`
	Host    string   `toml:"host"`
	Port    int      `toml:"port"`
	Passwd  string   `toml:"passwd"`
	Timeout Duration `toml:"timeout,omitempty"`
}

func (*Database) Decrypt

func (d *Database) Decrypt(decryptedKey string)

func (*Database) MakeConfig

func (d *Database) MakeConfig() (*mysql.Config, error)

type Decryptor

type Decryptor struct {
	*rsa.PrivateKey
}

func NewDecryptor

func NewDecryptor(decryptedKey string) (*Decryptor, error)

func (*Decryptor) Decrypt

func (d *Decryptor) Decrypt(data []byte) ([]byte, error)

func (*Decryptor) Encrypt

func (d *Decryptor) Encrypt(data []byte) ([]byte, error)

type Duration

type Duration struct {
	time.Duration
}

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

type LanguageDict

type LanguageDict map[string]any

type OSS

type OSS struct {
	Endpoint        string `toml:"endpoint,omitempty"`
	SharedEndpoint  string `toml:"shared_endpoint,omitempty"`
	Bucket          string `toml:"bucket"`
	AccessKeyID     string `toml:"access_key_id"`
	AccessKeySecret string `toml:"access_key_secret"`
	Product         string `toml:"product,omitempty"`
	Region          string `toml:"region,omitempty"`
}

func (*OSS) Decrypt

func (o *OSS) Decrypt(decryptedKey string)

Directories

Path Synopsis
rainbow
Package rainbow prints texts in beautiful rainbows in terminal.
Package rainbow prints texts in beautiful rainbows in terminal.

Jump to

Keyboard shortcuts

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