serve

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MiByte = 1 << 20
)

Variables

This section is empty.

Functions

func Encrypt

func Encrypt(x25519Key string, plaintext 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(dec *Decrypter)

func (*Database) MakeConfig

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

type Decrypter added in v0.20.1

type Decrypter struct {
	*ecdh.PrivateKey
}

func NewDecrypter added in v0.20.1

func NewDecrypter(x25519Key string) (*Decrypter, error)

func (*Decrypter) Decrypt added in v0.20.1

func (d *Decrypter) Decrypt(ciphertext string) (string, error)

func (*Decrypter) Encrypt added in v0.20.1

func (d *Decrypter) Encrypt(plaintext string) (string, 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(d *Decrypter)

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