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 RegisterFileRangeHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterFileUploadHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func UrlEncodeServeMuxOption() runtime.ServeMuxOption
- func XmlServeMuxOption() runtime.ServeMuxOption
- type FileHttpBodyMarshaler
- type UrlEncodeMarshal
- type XMLMarshaler
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 RegisterFileRangeHandler ¶
func RegisterFileRangeHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
注册文件Range下载.
func RegisterFileUploadHandler ¶
func RegisterFileUploadHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
注册文件上传.
func UrlEncodeServeMuxOption ¶
func UrlEncodeServeMuxOption() runtime.ServeMuxOption
注册x-www-form-urlencoded
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.
type UrlEncodeMarshal ¶
func (UrlEncodeMarshal) ContentType ¶
func (u UrlEncodeMarshal) ContentType(_ interface{}) string
ContentType means the content type of the response
func (UrlEncodeMarshal) Marshal ¶
func (u UrlEncodeMarshal) Marshal(v interface{}) ([]byte, error)
func (UrlEncodeMarshal) NewDecoder ¶
func (u UrlEncodeMarshal) NewDecoder(r io.Reader) runtime.Decoder
NewDecoder indicates how to decode the request
type XMLMarshaler ¶
func (XMLMarshaler) ContentType ¶
func (x XMLMarshaler) ContentType(v interface{}) string
func (XMLMarshaler) Marshal ¶
func (x XMLMarshaler) Marshal(v interface{}) ([]byte, error)
func (XMLMarshaler) NewDecoder ¶
func (x XMLMarshaler) NewDecoder(r io.Reader) runtime.Decoder
Source Files
¶
Click to show internal directories.
Click to hide internal directories.