utils

package
v0.0.0-...-a01428d Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirHandler

func DirHandler(pattern, dir string) http.HandlerFunc

func LocalId

func LocalId() string

func NewId

func NewId() string

Types

type Event

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

func NewEvent

func NewEvent() *Event

func (*Event) Signal

func (this *Event) Signal()

func (*Event) Wait

func (this *Event) Wait()

type List

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

func NewList

func NewList() *List

func (*List) Each

func (this *List) Each(cb func(v interface{}) (stop bool))

遍历列表 cb返回true时停止遍历,false继续遍历

func (*List) Len

func (this *List) Len() int

func (*List) Pop

func (this *List) Pop() interface{}

func (*List) Push

func (this *List) Push(v interface{})

func (*List) Remove

func (this *List) Remove(cb func(v interface{}) (del, c bool))

删除元素 cb返回true时删除当前元素

func (*List) Wait

func (this *List) Wait() <-chan byte

type Mux

type Mux struct {
	*http.ServeMux
}

func NewHttpMux

func NewHttpMux() *Mux

func (*Mux) HandleDir

func (this *Mux) HandleDir(pattern, dir string)

func (*Mux) ServeHTTP

func (this *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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