server

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Port to listen for incoming connections
	Port int `env:"PORT" envDefault:"1323"`
	// Timeout for outgoing http requests
	Timeout time.Duration `env:"TIMEOUT" envDefault:"60s"`
	// BotUA
	BotUA string `env:"BOT_UA" envDefault:"Mozilla/5.0 (compatible; SummalyBot/0.0.1; +https://github.com/yulog/go-summaly)"`
	// NonBotUA
	NonBotUA string `` /* 141-byte string literal not displayed */
	// RequireNonBotUAFile
	RequireNonBotUAFile string `env:"REQUIRE_NON_BOT_UA_FILE" envDefault:"./nonbot.txt"`
	// RequireNonBotUA
	RequireNonBotUA []string `env:"REQUIRE_NON_BOT_UA,file,expand" envDefault:"${REQUIRE_NON_BOT_UA_FILE}"`
	// AllowPrivateIP to connect private ip for test
	AllowPrivateIP bool `env:"ALLOW_PRIVATE_IP" envDefault:"false"`
}

type JSONSerializer

type JSONSerializer struct{}

func (*JSONSerializer) Deserialize

func (j *JSONSerializer) Deserialize(c echo.Context, i interface{}) error

func (*JSONSerializer) Serialize

func (j *JSONSerializer) Serialize(c echo.Context, i interface{}, indent string) error

type Query

type Query struct {
	URL  string `query:"url" json:"url" validate:"required,http_url"`
	Lang string `query:"lang" json:"lang" validate:"omitempty,bcp47_language_tag"`
}

type Server

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

func New

func New() *Server

func (*Server) Start

func (srv *Server) Start()

type Validator

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

func (*Validator) Validate

func (v *Validator) Validate(i interface{}) error

Jump to

Keyboard shortcuts

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