server

package
v0.0.0-...-df2cc63 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SessionName    = "SID"
	SessionManager = &Manager{list: list.New(), timeOut: 30, sessions: make(map[string]*list.Element)}
)
View Source
var (
	ABC_Conf, _ = apibox.Get_Conf()
)

Functions

func GetPID

func GetPID() string

func Handle

func Handle(method, pattern string, handler http.Handler)

func HandleFunc

func HandleFunc(method, pattern string, handler func(http.ResponseWriter, *http.Request))

func PathRegex

func PathRegex(pattern string) (params map[int]string, regex *regexp.Regexp, err error)

func RedirectHandler

func RedirectHandler(url string, code int) http.Handler

func Run

func Run()

Types

type Manager

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

func (*Manager) Destroy

func (m *Manager) Destroy(sid string)

func (*Manager) GC

func (m *Manager) GC()

func (*Manager) Init

func (m *Manager) Init(sid string, timeOut int) *Session

func (*Manager) Update

func (m *Manager) Update(sid string)

type ServeMux

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

func NewServeMux

func NewServeMux() *ServeMux

func (*ServeMux) AddStaticDir

func (mux *ServeMux) AddStaticDir(dir string) *ServeMux

func (*ServeMux) Handle

func (mux *ServeMux) Handle(method, pattern string, handler http.Handler)

func (*ServeMux) HandleFunc

func (mux *ServeMux) HandleFunc(method, pattern string, handler func(http.ResponseWriter, *http.Request))

func (*ServeMux) Handler

func (mux *ServeMux) Handler(r *http.Request) (h http.Handler, pattern string)

func (*ServeMux) ServeHTTP

func (mux *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Session

type Session struct {
	// contains filtered or unexported fields
}
var (
	DefaultServeMux = NewServeMux()
	WebSession      *Session
)

func RegSession

func RegSession(w http.ResponseWriter, r *http.Request, timeout int, enableTls bool) *Session

func (*Session) Del

func (s *Session) Del(key interface{})

func (*Session) Get

func (s *Session) Get(key interface{}) interface{}

func (*Session) ID

func (s *Session) ID() string

func (*Session) Set

func (s *Session) Set(key, value interface{})

Jump to

Keyboard shortcuts

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