configure

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configure

type Configure struct {
	HTTP    HTTP
	System  System
	Session Session
	DB      DB
	Logger  logger.Options
}

func DefaultConfigure

func DefaultConfigure() *Configure

DefaultConfigure return default Configure

func (*Configure) Load

func (c *Configure) Load(filename string) (e error)

func (*Configure) String

func (c *Configure) String() string

type Connect

type Connect struct {
	URL      string
	Insecure bool // Allow insecure server connections when using SSL
	Option   ServerOption
}

type DB

type DB struct {
	Driver  string
	Source  []string
	ShowSQL bool

	Cache struct {
		Record  int
		Direct  []string
		Special []struct {
			Name   string
			Record int
		}
	}
	MaxOpen, MaxIdle int
}

type HTTP

type HTTP struct {
	Addr string

	CertFile string
	KeyFile  string

	Swagger bool

	Option ServerOption
}

HTTP configure

func (*HTTP) H2

func (h *HTTP) H2() bool

H2 if tls return true

func (*HTTP) H2C

func (h *HTTP) H2C() bool

H2C if not use tls return true

type Mount

type Mount struct {
	// web display name
	Name string
	// local file path
	Root string

	Read   bool
	Write  bool
	Shared bool
}

type ServerOption

type ServerOption struct {
	WriteBufferSize, ReadBufferSize          int
	InitialWindowSize, InitialConnWindowSize int32
	MaxRecvMsgSize, MaxSendMsgSize           int
	MaxConcurrentStreams                     uint32
	ConnectionTimeout                        time.Duration
	Keepalive                                keepalive.ServerParameters
}

type Session

type Session struct {
	Memory SessionMemory
}

type SessionManager

type SessionManager struct {
	Method string
	Key    string
}

type SessionMemory

type SessionMemory struct {
	Manager  SessionManager
	Provider SessionProvider
}

type SessionProvider

type SessionProvider struct {
	Backend string
	Memory  SessionProviderMemory
	Redis   SessionProviderRedis
	Bolt    SessionProviderBolt
}

type SessionProviderBolt

type SessionProviderBolt struct {
	Filename string

	Access   time.Duration
	Refresh  time.Duration
	Deadline time.Duration
	MaxSize  int64
}

type SessionProviderMemory

type SessionProviderMemory struct {
	Access   time.Duration
	Refresh  time.Duration
	Deadline time.Duration
	MaxSize  int
}

type SessionProviderRedis

type SessionProviderRedis struct {
	URL      string
	Access   time.Duration
	Refresh  time.Duration
	Deadline time.Duration
}

type Slave

type Slave struct {
	Connect Connect
	System  System
	DB      DB
	Logger  logger.Options
}

func DefaultSlave

func DefaultSlave() *Slave

DefaultSlave return slave configure

func (*Slave) Load

func (c *Slave) Load(filename string) (e error)

func (*Slave) String

func (c *Slave) String() string

type System

type System struct {
	Enable      bool
	Shell       string
	VNC         string
	PortForward bool
	Mount       []Mount
}

func DefaultSystem

func DefaultSystem() *System

Jump to

Keyboard shortcuts

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