app

package
v0.0.0-...-184715f Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	CommonOpts
	Storage     *storage.BoltStorage
	HashEncoder *hash.Hash
	Templates   *tpl.Templates
	// contains filtered or unexported fields
}

App is a Pad application

func New

func New(commonOpts CommonOpts) (*App, error)

New prepares application

func (*App) Run

func (a *App) Run(ctx context.Context, address string, port int) error

Run listens on the TCP network address srv.Addr and then calls Serve to handle requests on incoming connections.

type CommonOpts

type CommonOpts struct {
	BoltPath   string
	SecretKey  string
	StaticPath string
	TmlPath    string
	TplExt     string
}

CommonOpts is the options that provided into handlers

func (*CommonOpts) SetCommon

func (c *CommonOpts) SetCommon(commonOpts CommonOpts)

SetCommon apply the options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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