corekit

package module
v0.0.0-...-f006713 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2017 License: BSD-3-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIHandler

type APIHandler func(req *http.Request) (interface{}, error)

API Handler

type Option

type Option func(o *Options)

func DependencyInfo

func DependencyInfo(name string, f func() interface{}) Option

func Https

func Https(certFile, keyFile string) Option

func Logger

func Logger(l func(format string, args ...interface{})) Option

func Name

func Name(n string) Option

func Param

func Param(name, val string) Option

func Port

func Port(port int) Option

func UseServeMux

func UseServeMux(mux ServeMux) Option

func Version

func Version(v string) Option

type Options

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

type ServeMux

type ServeMux interface {
	Add(meth string, pat string, h http.Handler)
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

type Service

type Service interface {
	Get(path string, handler APIHandler)
	Post(path string, handler APIHandler)
	Put(path string, handler APIHandler)
	Del(path string, handler APIHandler)
	Stream(path string, handler StreamAPIHandler)

	Run()
}

func NewService

func NewService(opts ...Option) Service

type StreamAPIHandler

type StreamAPIHandler func(req *http.Request) (receiver chan []byte, cancel chan struct{}, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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