access

package
v0.0.0-...-24d406a Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = &Options{
	After:  os.Stdout,
	Format: "text",
	Layout: "2006-01-02 15:04:05",
	Comma:  ',',
	Fields: []string{
		"time",
		"addr",
		"method",
		"host",
		"uri",
		"proto",
		"referer",
		"ua",
		"panic",
		"status",
		"size",
		"duration",
		"count",
		"r_x_forwarded_for",
	},
}

Functions

func New

func New(o *Options) tiny.HandlerFunc

Types

type Access

type Access struct {
	Off bool
	// contains filtered or unexported fields
}

func Pull

func Pull(ctx *tiny.Context) *Access

func (*Access) CSV

func (a *Access) CSV() []string

func (*Access) Del

func (a *Access) Del(k string)

func (*Access) Get

func (a *Access) Get(k string) interface{}

func (*Access) JSON

func (a *Access) JSON() []byte

func (*Access) Set

func (a *Access) Set(k string, v interface{})

func (*Access) Text

func (a *Access) Text() []byte

type Options

type Options struct {
	Before, After  io.Writer
	Format, Layout string
	Comma          rune
	UseCRLF        bool
	Fields         []string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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