http_server

package
v0.0.0-...-fb4ca4a Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2018 License: GPL-3.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dir

func Dir(useLocal bool, name string) http.FileSystem

Dir returns a http.Filesystem for the embedded assets on a given prefix dir. If useLocal is true, the filesystem's contents are instead used.

func FS

func FS(useLocal bool) http.FileSystem

FS returns a http.Filesystem for the embedded assets. If useLocal is true, the filesystem's contents are instead used.

func FSByte

func FSByte(useLocal bool, name string) ([]byte, error)

FSByte returns the named file from the embedded assets. If useLocal is true, the filesystem's contents are instead used.

func FSMustByte

func FSMustByte(useLocal bool, name string) []byte

FSMustByte is the same as FSByte, but panics if name is not present.

func FSMustString

func FSMustString(useLocal bool, name string) string

FSMustString is the string version of FSMustByte.

func FSString

func FSString(useLocal bool, name string) (string, error)

FSString is the string version of FSByte.

Types

type HTTPServer

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

func New

func New(addr string, devMode bool) *HTTPServer

New create HTTPServer on `addr` if `devMode=true` then we use localFS instead of memFS

func (*HTTPServer) Start

func (h *HTTPServer) Start() error

type InfoResp

type InfoResp struct {
	Status string      `json:"status"`
	Data   interface{} `json:"data"`
	Error  string      `json:"error"`
}

type InvokeReq

type InvokeReq struct {
	Addr        string             `json:"addr"`
	ServiceName string             `json:"service_name"`
	PackageName string             `json:"package_name"`
	MethodName  string             `json:"method_name"`
	GRPCArgs    []proto.FieldValue `json:"grpc_args"`
}

type InvokeResp

type InvokeResp struct {
	Status string      `json:"status"`
	Data   interface{} `json:"data"`
	Error  string      `json:"error"`
}

type InvokeStreamReq

type InvokeStreamReq struct {
	GRPCMethod string `json:"grpc_method"`
	GRPCArgs   string `json:"grpc_args"`
}

type InvokeStreamResp

type InvokeStreamResp struct {
	Status string      `json:"status"`
	Data   interface{} `json:"data"`
	Error  string      `json:"error"`
}

Jump to

Keyboard shortcuts

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