jmash

package
v0.0.0-...-469a15f Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 18 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowCORS

func AllowCORS(h http.Handler) http.Handler

allowCORS allows Cross Origin Resoruce Sharing from any origin. Don't do this without consideration in production systems.

func FileServeMuxOption

func FileServeMuxOption() runtime.ServeMuxOption

自定义文件下载解析,去掉换行符.

func HealthzServer

func HealthzServer(conn *grpc.ClientConn) http.HandlerFunc

healthzServer returns a simple health handler which returns ok.

func PrintlnProtoReq

func PrintlnProtoReq(protoReq servicepb.FileUploadReq)

func RegisterFileUploadHandler

func RegisterFileUploadHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

注册文件上传.

Types

type FileHttpBodyMarshaler

type FileHttpBodyMarshaler struct {
	runtime.Marshaler
}

自定义文件解析

func (*FileHttpBodyMarshaler) ContentType

func (h *FileHttpBodyMarshaler) ContentType(v interface{}) string

ContentType returns its specified content type in case v is a google.api.HttpBody message, otherwise it will fall back to the default Marshalers content type.

func (*FileHttpBodyMarshaler) Delimiter

func (t *FileHttpBodyMarshaler) Delimiter() []byte

分隔符设置未”,默认换行.

func (*FileHttpBodyMarshaler) Marshal

func (h *FileHttpBodyMarshaler) Marshal(v interface{}) ([]byte, error)

Marshal marshals "v" by returning the body bytes if v is a google.api.HttpBody message, otherwise it falls back to the default Marshaler.

Directories

Path Synopsis
Package basic is a reverse proxy.
Package basic is a reverse proxy.

Jump to

Keyboard shortcuts

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