Documentation ¶
Index ¶
- func Bool(val string) (bool, error)
- func BoolSlice(val, sep string) ([]bool, error)
- func BoolValue(val string) (*wrapperspb.BoolValue, error)
- func Bytes(val string) ([]byte, error)
- func BytesSlice(val, sep string) ([][]byte, error)
- func BytesValue(val string) (*wrapperspb.BytesValue, error)
- func DoubleValue(val string) (*wrapperspb.DoubleValue, error)
- func Duration(val string) (*durationpb.Duration, error)
- func Enum(val string, enumValMap map[string]int32) (int32, error)
- func EnumSlice(val, sep string, enumValMap map[string]int32) ([]int32, error)
- func FieldMaskFromRequestBody(r io.Reader, msg proto.Message) (*field_mask.FieldMask, error)
- func Float32(val string) (float32, error)
- func Float32Slice(val, sep string) ([]float32, error)
- func Float64(val string) (float64, error)
- func Float64Slice(val, sep string) ([]float64, error)
- func FloatValue(val string) (*wrapperspb.FloatValue, error)
- func HTTPStatusCode(c codes.Code) int
- func HTTPStatusFromCode(code codes.Code) int
- func Int32(val string) (int32, error)
- func Int32Slice(val, sep string) ([]int32, error)
- func Int32Value(val string) (*wrapperspb.Int32Value, error)
- func Int64(val string) (int64, error)
- func Int64Slice(val, sep string) ([]int64, error)
- func Int64Value(val string) (*wrapperspb.Int64Value, error)
- func PopulateFieldFromPath(msg proto.Message, fieldPathString string, value string) error
- func PopulateQueryParameters(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error
- func String(val string) (string, error)
- func StringSlice(val, sep string) ([]string, error)
- func StringValue(val string) (*wrapperspb.StringValue, error)
- func Timestamp(val string) (*timestamppb.Timestamp, error)
- func UInt32Value(val string) (*wrapperspb.UInt32Value, error)
- func UInt64Value(val string) (*wrapperspb.UInt64Value, error)
- func Uint32(val string) (uint32, error)
- func Uint32Slice(val, sep string) ([]uint32, error)
- func Uint64(val string) (uint64, error)
- func Uint64Slice(val, sep string) ([]uint64, error)
- func WSStatusCode(c codes.Code) ws.StatusCode
- type Codec
- type CodecJSON
- func (c CodecJSON) Marshal(v interface{}) ([]byte, error)
- func (c CodecJSON) MarshalAppend(b []byte, v interface{}) ([]byte, error)
- func (CodecJSON) Name() string
- func (c CodecJSON) ReadNext(b []byte, r io.Reader, limit int) ([]byte, int, error)
- func (c CodecJSON) Unmarshal(data []byte, v interface{}) error
- func (c CodecJSON) WriteNext(w io.Writer, b []byte) (int, error)
- type CodecProto
- func (c CodecProto) Marshal(v interface{}) ([]byte, error)
- func (c CodecProto) MarshalAppend(b []byte, v interface{}) ([]byte, error)
- func (CodecProto) Name() string
- func (c CodecProto) ReadNext(b []byte, r io.Reader, limit int) ([]byte, int, error)
- func (CodecProto) Unmarshal(data []byte, v interface{}) error
- func (c CodecProto) WriteNext(w io.Writer, b []byte) (int, error)
- type Compressor
- type CompressorGzip
- type DefaultQueryParser
- type Gateway
- type Mux
- func (m *Mux) App() *fiber.App
- func (m *Mux) FastClient() *fasthttp.Client
- func (m *Mux) GetPathRules() []*httpPathRule
- func (m *Mux) Handler(ctx *fiber.Ctx) error
- func (m *Mux) HttpClient() *http.Client
- func (m *Mux) Invoke(ctx context.Context, method string, args any, reply any, ...) error
- func (m *Mux) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, ...) (grpc.ClientStream, error)
- func (m *Mux) RegisterService(sd *grpc.ServiceDesc, ss interface{})
- func (m *Mux) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- func (m *Mux) SetRequestDecoder(name protoreflect.FullName, f func(ctx *fiber.Ctx, msg proto.Message) error)
- func (m *Mux) SetResponseEncoder(name protoreflect.FullName, f func(ctx *fiber.Ctx, msg proto.Message) error)
- func (m *Mux) SetStreamInterceptor(interceptor grpc.StreamServerInterceptor)
- func (m *Mux) SetUnaryInterceptor(interceptor grpc.UnaryServerInterceptor)
- type MuxOption
- func CodecOption(contentType string, c Codec) MuxOption
- func CompressorOption(contentEncoding string, c Compressor) MuxOption
- func ConnectionTimeoutOption(d time.Duration) MuxOption
- func FilesOption(f *protoregistry.Files) MuxOption
- func MaxReceiveMessageSizeOption(s int) MuxOption
- func MaxSendMessageSizeOption(s int) MuxOption
- func StreamServerInterceptorOption(interceptor grpc.StreamServerInterceptor) MuxOption
- func TypesOption(t protoregistry.MessageTypeResolver) MuxOption
- func UnaryServerInterceptorOption(interceptor grpc.UnaryServerInterceptor) MuxOption
- type QueryParameterParser
- type StreamCodec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolSlice ¶
BoolSlice converts 'val' where individual booleans are separated by 'sep' into a bool slice.
func BoolValue ¶
func BoolValue(val string) (*wrapperspb.BoolValue, error)
BoolValue well-known type support as wrapper around bool type
func Bytes ¶
Bytes converts the given string representation of a byte sequence into a slice of bytes A bytes sequence is encoded in URL-safe base64 without padding
func BytesSlice ¶
BytesSlice converts 'val' where individual bytes sequences, encoded in URL-safe base64 without padding, are separated by 'sep' into a slice of bytes slices slice.
func BytesValue ¶
func BytesValue(val string) (*wrapperspb.BytesValue, error)
BytesValue well-known type support as wrapper around bytes[] type
func DoubleValue ¶
func DoubleValue(val string) (*wrapperspb.DoubleValue, error)
DoubleValue well-known type support as wrapper around float64 type
func Duration ¶
func Duration(val string) (*durationpb.Duration, error)
Duration converts the given string into a timestamp.Duration.
func Enum ¶
Enum converts the given string into an int32 that should be type casted into the correct enum proto type.
func EnumSlice ¶
EnumSlice converts 'val' where individual enums are separated by 'sep' into a int32 slice. Each individual int32 should be type casted into the correct enum proto type.
func FieldMaskFromRequestBody ¶
FieldMaskFromRequestBody creates a FieldMask printing all complete paths from the JSON body.
func Float32 ¶
Float32 converts the given string representation of a floating point number into float32.
func Float32Slice ¶
Float32Slice converts 'val' where individual floating point numbers are separated by 'sep' into a float32 slice.
func Float64 ¶
Float64 converts the given string representation into representation of a floating point number into float64.
func Float64Slice ¶
Float64Slice converts 'val' where individual floating point numbers are separated by 'sep' into a float64 slice.
func FloatValue ¶
func FloatValue(val string) (*wrapperspb.FloatValue, error)
FloatValue well-known type support as wrapper around float32 type
func HTTPStatusCode ¶
func HTTPStatusFromCode ¶
HTTPStatusFromCode converts a gRPC error code into the corresponding HTTP response status. See: https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto
func Int32Slice ¶
Int32Slice converts 'val' where individual integers are separated by 'sep' into a int32 slice.
func Int32Value ¶
func Int32Value(val string) (*wrapperspb.Int32Value, error)
Int32Value well-known type support as wrapper around int32 type
func Int64Slice ¶
Int64Slice converts 'val' where individual integers are separated by 'sep' into a int64 slice.
func Int64Value ¶
func Int64Value(val string) (*wrapperspb.Int64Value, error)
Int64Value well-known type support as wrapper around int64 type
func PopulateFieldFromPath ¶
PopulateFieldFromPath sets a value in a nested Protobuf structure.
func PopulateQueryParameters ¶
func PopulateQueryParameters(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error
PopulateQueryParameters parses query parameters into "msg" using current query parser
func StringSlice ¶
StringSlice converts 'val' where individual strings are separated by 'sep' into a string slice.
func StringValue ¶
func StringValue(val string) (*wrapperspb.StringValue, error)
StringValue well-known type support as wrapper around string type
func Timestamp ¶
func Timestamp(val string) (*timestamppb.Timestamp, error)
Timestamp converts the given RFC3339 formatted string into a timestamp.Timestamp.
func UInt32Value ¶
func UInt32Value(val string) (*wrapperspb.UInt32Value, error)
UInt32Value well-known type support as wrapper around uint32 type
func UInt64Value ¶
func UInt64Value(val string) (*wrapperspb.UInt64Value, error)
UInt64Value well-known type support as wrapper around uint64 type
func Uint32Slice ¶
Uint32Slice converts 'val' where individual integers are separated by 'sep' into a uint32 slice.
func Uint64Slice ¶
Uint64Slice converts 'val' where individual integers are separated by 'sep' into a uint64 slice.
func WSStatusCode ¶
func WSStatusCode(c codes.Code) ws.StatusCode
Types ¶
type Codec ¶
type Codec interface { encoding.Codec // MarshalAppend appends the marshaled form of v to b and returns the result. MarshalAppend([]byte, interface{}) ([]byte, error) }
Codec defines the interface used to encode and decode messages.
type CodecJSON ¶
type CodecJSON struct { protojson.MarshalOptions protojson.UnmarshalOptions }
CodecJSON is a Codec implementation with protobuf json format.
func (CodecJSON) MarshalAppend ¶
type CodecProto ¶
type CodecProto struct {
proto.MarshalOptions
}
CodecProto is a Codec implementation with protobuf binary format.
func (CodecProto) Marshal ¶
func (c CodecProto) Marshal(v interface{}) ([]byte, error)
func (CodecProto) MarshalAppend ¶
func (c CodecProto) MarshalAppend(b []byte, v interface{}) ([]byte, error)
func (CodecProto) Name ¶
func (CodecProto) Name() string
Name == "proto" overwritting internal proto codec
func (CodecProto) Unmarshal ¶
func (CodecProto) Unmarshal(data []byte, v interface{}) error
type Compressor ¶
type Compressor interface { encoding.Compressor }
Compressor is used to compress and decompress messages. Based on grpc/encoding.
type CompressorGzip ¶
type CompressorGzip struct { Level *int // contains filtered or unexported fields }
CompressorGzip implements the Compressor interface. Based on grpc/encoding/gzip.
func (*CompressorGzip) Compress ¶
func (c *CompressorGzip) Compress(w io.Writer) (io.WriteCloser, error)
Compress implements the Compressor interface.
func (*CompressorGzip) Decompress ¶
Decompress implements the Compressor interface.
type DefaultQueryParser ¶
type DefaultQueryParser struct{}
DefaultQueryParser is a QueryParameterParser which implements the default query parameters parsing behavior.
See https://github.com/grpc-ecosystem/grpc-gateway/issues/2632 for more context.
func (*DefaultQueryParser) Parse ¶
func (*DefaultQueryParser) Parse(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error
Parse populates "values" into "msg". A value is ignored if its key starts with one of the elements in "filter".
type Gateway ¶
type Gateway interface { grpc.ClientConnInterface SetUnaryInterceptor(interceptor grpc.UnaryServerInterceptor) SetStreamInterceptor(interceptor grpc.StreamServerInterceptor) SetResponseEncoder(protoreflect.FullName, func(ctx *fiber.Ctx, msg proto.Message) error) SetRequestDecoder(protoreflect.FullName, func(ctx *fiber.Ctx, msg proto.Message) error) RegisterService(sd *grpc.ServiceDesc, ss interface{}) Handler(*fiber.Ctx) error HttpClient() *http.Client FastClient() *fasthttp.Client GetPathRules() []*httpPathRule App() *fiber.App }
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
func (*Mux) FastClient ¶
func (*Mux) GetPathRules ¶
func (m *Mux) GetPathRules() []*httpPathRule
func (*Mux) HttpClient ¶
func (*Mux) NewStream ¶
func (m *Mux) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
func (*Mux) RegisterService ¶
func (m *Mux) RegisterService(sd *grpc.ServiceDesc, ss interface{})
RegisterService satisfies grpc.ServiceRegistrar for generated service code hooks.
func (*Mux) SetRequestDecoder ¶
func (*Mux) SetResponseEncoder ¶
func (*Mux) SetStreamInterceptor ¶
func (m *Mux) SetStreamInterceptor(interceptor grpc.StreamServerInterceptor)
SetStreamInterceptor configures the in-process channel to use the given server interceptor for streaming RPCs when dispatching.
func (*Mux) SetUnaryInterceptor ¶
func (m *Mux) SetUnaryInterceptor(interceptor grpc.UnaryServerInterceptor)
type MuxOption ¶
type MuxOption func(*muxOptions)
MuxOption is an option for a mux.
func CodecOption ¶
CodecOption registers a codec for the given content type.
func CompressorOption ¶
func CompressorOption(contentEncoding string, c Compressor) MuxOption
CompressorOption registers a compressor for the given content encoding.
func ConnectionTimeoutOption ¶
func FilesOption ¶
func FilesOption(f *protoregistry.Files) MuxOption
func StreamServerInterceptorOption ¶
func StreamServerInterceptorOption(interceptor grpc.StreamServerInterceptor) MuxOption
func TypesOption ¶
func TypesOption(t protoregistry.MessageTypeResolver) MuxOption
func UnaryServerInterceptorOption ¶
func UnaryServerInterceptorOption(interceptor grpc.UnaryServerInterceptor) MuxOption
type QueryParameterParser ¶
type QueryParameterParser interface {
Parse(msg proto.Message, values url.Values, filter *utilities.DoubleArray) error
}
QueryParameterParser defines interface for all query parameter parsers
type StreamCodec ¶
type StreamCodec interface { Codec // ReadNext returns the size of the next message appended to buf. // ReadNext reads from r until either it has read a complete message or // encountered an error and returns all the data read from r. // The message is contained in dst[:n]. // Excess data read from r is stored in dst[n:]. ReadNext(buf []byte, r io.Reader, limit int) (dst []byte, n int, err error) // WriteNext writes the message to w with a size aware encoding // returning the number of bytes written. WriteNext(w io.Writer, src []byte) (n int, err error) }
StreamCodec is used in streaming RPCs where the message boundaries are determined by the codec.