Documentation ¶
Index ¶
- func AllowCORS(h http.Handler) http.Handler
- func FileServeMuxOption() runtime.ServeMuxOption
- func HealthzServer(conn *grpc.ClientConn) http.HandlerFunc
- func PrintlnProtoReq(protoReq servicepb.FileUploadReq)
- func RegisterFileUploadHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- type FileHttpBodyMarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowCORS ¶
allowCORS allows Cross Origin Resoruce Sharing from any origin. Don't do this without consideration in production systems.
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 ¶
自定义文件解析
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.
Click to show internal directories.
Click to hide internal directories.