Documentation
¶
Index ¶
- Variables
- func DefaultSlice[V any](v *[]V, defaultValue []V)
- func DefaultVal[V comparable](v *V, defaultValue V)
- func DefaultValPtr[V any](v **V, defaultValue V)
- func Duration(d **durationpb.Duration, defaultValue time.Duration)
- func HeaderKVToHTTPHeader(from []*HeaderKV) http.Header
- func NotNil(field any)
- func ParseYAMLToProto(rawYAML []byte, msg proto.Message) error
- func QueryKVToURLValues(from []*QueryKV) url.Values
- func UnmarshalProto(opts proto.UnmarshalOptions, data mem.BufferSlice, v any) error
- type HeaderKV
- type HeaderValues
- type HttpRequest
- func (*HttpRequest) Descriptor() ([]byte, []int)deprecated
- func (x *HttpRequest) GetHeader() []*HeaderKV
- func (x *HttpRequest) GetMethod() string
- func (x *HttpRequest) GetQuery() []*QueryKV
- func (x *HttpRequest) GetUrlPath() string
- func (x *HttpRequest) HTTPHeader() http.Header
- func (x *HttpRequest) IsUpgrade() bool
- func (*HttpRequest) ProtoMessage()
- func (x *HttpRequest) ProtoReflect() protoreflect.Message
- func (x *HttpRequest) Reset()
- func (x *HttpRequest) String() string
- func (x *HttpRequest) URLQuery() url.Values
- type HttpResponse
- func (*HttpResponse) Descriptor() ([]byte, []int)deprecated
- func (x *HttpResponse) GetHeader() []*HeaderKV
- func (x *HttpResponse) GetStatus() string
- func (x *HttpResponse) GetStatusCode() int32
- func (x *HttpResponse) HTTPHeader() http.Header
- func (*HttpResponse) ProtoMessage()
- func (x *HttpResponse) ProtoReflect() protoreflect.Message
- func (x *HttpResponse) Reset()
- func (x *HttpResponse) String() string
- type NopValidator
- type ProtoErrMarshaler
- type QueryKV
- type QueryValues
Constants ¶
This section is empty.
Variables ¶
View Source
var File_internal_tool_prototool_prototool_proto protoreflect.FileDescriptor
Functions ¶
func DefaultSlice ¶
func DefaultSlice[V any](v *[]V, defaultValue []V)
func DefaultVal ¶
func DefaultVal[V comparable](v *V, defaultValue V)
func DefaultValPtr ¶
func DefaultValPtr[V any](v **V, defaultValue V)
func HeaderKVToHTTPHeader ¶
HeaderKVToHTTPHeader converts the internal []*HeaderKV type to http.Header. The returned http.Header has canonicalized keys.
func NotNil ¶
func NotNil(field any)
NotNil ensures that the memory that the field pointer is pointing to is not nil. field must be a valid pointer. It's target is checked for nil-ness and populated if it's nil.
func QueryKVToURLValues ¶
func UnmarshalProto ¶
func UnmarshalProto(opts proto.UnmarshalOptions, data mem.BufferSlice, v any) error
Types ¶
type HeaderKV ¶
type HeaderKV struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value *HeaderValues `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func HTTPHeaderToHeaderKV ¶
func (*HeaderKV) Descriptor
deprecated
func (*HeaderKV) GetValue ¶
func (x *HeaderKV) GetValue() *HeaderValues
func (*HeaderKV) ProtoMessage ¶
func (*HeaderKV) ProtoMessage()
func (*HeaderKV) ProtoReflect ¶
func (x *HeaderKV) ProtoReflect() protoreflect.Message
type HeaderValues ¶
type HeaderValues struct { Value [][]byte `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*HeaderValues) Descriptor
deprecated
func (*HeaderValues) Descriptor() ([]byte, []int)
Deprecated: Use HeaderValues.ProtoReflect.Descriptor instead.
func (*HeaderValues) GetValue ¶
func (x *HeaderValues) GetValue() [][]byte
func (*HeaderValues) ProtoMessage ¶
func (*HeaderValues) ProtoMessage()
func (*HeaderValues) ProtoReflect ¶
func (x *HeaderValues) ProtoReflect() protoreflect.Message
func (*HeaderValues) Reset ¶
func (x *HeaderValues) Reset()
func (*HeaderValues) String ¶
func (x *HeaderValues) String() string
type HttpRequest ¶
type HttpRequest struct { Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` Header []*HeaderKV `protobuf:"bytes,2,rep,name=header,proto3" json:"header,omitempty"` UrlPath string `protobuf:"bytes,3,opt,name=url_path,json=urlPath,proto3" json:"url_path,omitempty"` Query []*QueryKV `protobuf:"bytes,4,rep,name=query,proto3" json:"query,omitempty"` // contains filtered or unexported fields }
func (*HttpRequest) Descriptor
deprecated
func (*HttpRequest) Descriptor() ([]byte, []int)
Deprecated: Use HttpRequest.ProtoReflect.Descriptor instead.
func (*HttpRequest) GetHeader ¶
func (x *HttpRequest) GetHeader() []*HeaderKV
func (*HttpRequest) GetMethod ¶
func (x *HttpRequest) GetMethod() string
func (*HttpRequest) GetQuery ¶
func (x *HttpRequest) GetQuery() []*QueryKV
func (*HttpRequest) GetUrlPath ¶
func (x *HttpRequest) GetUrlPath() string
func (*HttpRequest) HTTPHeader ¶
func (x *HttpRequest) HTTPHeader() http.Header
func (*HttpRequest) IsUpgrade ¶
func (x *HttpRequest) IsUpgrade() bool
func (*HttpRequest) ProtoMessage ¶
func (*HttpRequest) ProtoMessage()
func (*HttpRequest) ProtoReflect ¶
func (x *HttpRequest) ProtoReflect() protoreflect.Message
func (*HttpRequest) Reset ¶
func (x *HttpRequest) Reset()
func (*HttpRequest) String ¶
func (x *HttpRequest) String() string
func (*HttpRequest) URLQuery ¶
func (x *HttpRequest) URLQuery() url.Values
type HttpResponse ¶
type HttpResponse struct { StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` Header []*HeaderKV `protobuf:"bytes,3,rep,name=header,proto3" json:"header,omitempty"` // contains filtered or unexported fields }
func (*HttpResponse) Descriptor
deprecated
func (*HttpResponse) Descriptor() ([]byte, []int)
Deprecated: Use HttpResponse.ProtoReflect.Descriptor instead.
func (*HttpResponse) GetHeader ¶
func (x *HttpResponse) GetHeader() []*HeaderKV
func (*HttpResponse) GetStatus ¶
func (x *HttpResponse) GetStatus() string
func (*HttpResponse) GetStatusCode ¶
func (x *HttpResponse) GetStatusCode() int32
func (*HttpResponse) HTTPHeader ¶
func (x *HttpResponse) HTTPHeader() http.Header
func (*HttpResponse) ProtoMessage ¶
func (*HttpResponse) ProtoMessage()
func (*HttpResponse) ProtoReflect ¶
func (x *HttpResponse) ProtoReflect() protoreflect.Message
func (*HttpResponse) Reset ¶
func (x *HttpResponse) Reset()
func (*HttpResponse) String ¶
func (x *HttpResponse) String() string
type NopValidator ¶
type NopValidator struct{}
func (NopValidator) Validate ¶
func (NopValidator) Validate(proto.Message, ...protovalidate.ValidationOption) error
type ProtoErrMarshaler ¶
type ProtoErrMarshaler struct { }
type QueryKV ¶
type QueryKV struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value *QueryValues `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func URLValuesToQueryKV ¶
func (*QueryKV) Descriptor
deprecated
func (*QueryKV) GetValue ¶
func (x *QueryKV) GetValue() *QueryValues
func (*QueryKV) ProtoMessage ¶
func (*QueryKV) ProtoMessage()
func (*QueryKV) ProtoReflect ¶
func (x *QueryKV) ProtoReflect() protoreflect.Message
type QueryValues ¶
type QueryValues struct { Value [][]byte `protobuf:"bytes,1,rep,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*QueryValues) Descriptor
deprecated
func (*QueryValues) Descriptor() ([]byte, []int)
Deprecated: Use QueryValues.ProtoReflect.Descriptor instead.
func (*QueryValues) GetValue ¶
func (x *QueryValues) GetValue() [][]byte
func (*QueryValues) ProtoMessage ¶
func (*QueryValues) ProtoMessage()
func (*QueryValues) ProtoReflect ¶
func (x *QueryValues) ProtoReflect() protoreflect.Message
func (*QueryValues) Reset ¶
func (x *QueryValues) Reset()
func (*QueryValues) String ¶
func (x *QueryValues) String() string
Click to show internal directories.
Click to hide internal directories.