http

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Any

type Any struct {
	jsoniter.Any
}

func (*Any) Bytes

func (a *Any) Bytes() []byte

func (*Any) Decode

func (a *Any) Decode(v any) error

func (*Any) Float64

func (a *Any) Float64() float64

func (*Any) Int

func (a *Any) Int() int

func (*Any) Int64

func (a *Any) Int64() int64

func (*Any) String

func (a *Any) String() string

type Array

type Array []*Any

func (Array) Float64

func (a Array) Float64() []float64

func (Array) Int

func (a Array) Int() []int

func (Array) String

func (a Array) String() []string

type Files

type Files struct {
	// contains filtered or unexported fields
}

func (*Files) All

func (f *Files) All(fileName string) []*multipart.FileHeader

func (*Files) Empty

func (f *Files) Empty(fileName string) bool

func (*Files) Files

func (f *Files) Files() map[string][]*multipart.FileHeader

func (*Files) First

func (f *Files) First(fileName string) *multipart.FileHeader

func (*Files) Has

func (f *Files) Has(fileName string) bool

func (*Files) Index

func (f *Files) Index(fileName string, index int) *multipart.FileHeader

func (*Files) Name

func (f *Files) Name(fileName string) Value

func (*Files) String

func (f *Files) String() string

type Json

type Json struct {
	// contains filtered or unexported fields
}

func (*Json) Any

func (j *Json) Any() *Any

func (*Json) Array

func (j *Json) Array(path ...any) Array

func (*Json) Bytes

func (j *Json) Bytes() []byte

func (*Json) Decode

func (j *Json) Decode(v any) error

func (*Json) Empty

func (j *Json) Empty(key string) bool

func (*Json) Get

func (j *Json) Get(path ...any) Value

func (*Json) Has

func (j *Json) Has(key string) bool

func (*Json) Path

func (j *Json) Path(path ...any) *Any

func (*Json) Reset

func (j *Json) Reset(data any) *Any

func (*Json) String

func (j *Json) String() string

type Packer

type Packer interface {
}

type Parser

type Parser[T Packer] struct {
	// contains filtered or unexported fields
}

func (*Parser[T]) Auto

func (s *Parser[T]) Auto()

func (*Parser[T]) Error

func (s *Parser[T]) Error() error

func (*Parser[T]) Form

func (s *Parser[T]) Form()

func (*Parser[T]) HasParse

func (s *Parser[T]) HasParse() bool

func (*Parser[T]) Json

func (s *Parser[T]) Json()

func (*Parser[T]) Multipart

func (s *Parser[T]) Multipart()

func (*Parser[T]) Protobuf

func (s *Parser[T]) Protobuf()

func (*Parser[T]) Query

func (s *Parser[T]) Query()

func (*Parser[T]) SetMaxMemory

func (s *Parser[T]) SetMaxMemory(maxMemory int64)

type Protobuf

type Protobuf struct {
	// contains filtered or unexported fields
}

func (*Protobuf) Bytes

func (p *Protobuf) Bytes() []byte

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

func NewSender

func NewSender(w http.ResponseWriter, r *http.Request) *Sender

func (*Sender) Any

func (s *Sender) Any(data any) error

func (*Sender) Bytes

func (s *Sender) Bytes(data []byte) error

func (*Sender) File

func (s *Sender) File(fileName string, file io.Reader) error

func (*Sender) Json

func (s *Sender) Json(data any) error

func (*Sender) Protobuf

func (s *Sender) Protobuf(data proto.Message) error

func (*Sender) Respond

func (s *Sender) Respond(code int, msg any) error

func (*Sender) RespondWithError

func (s *Sender) RespondWithError(code int, err error) error

func (*Sender) String

func (s *Sender) String(data string) error

type Sse

type Sse[T any] struct {
	Stream      *Stream[T]
	LasTEventID int64
	// contains filtered or unexported fields
}

func (*Sse[T]) Any

func (s *Sse[T]) Any(data any) error

func (*Sse[T]) Bytes

func (s *Sse[T]) Bytes(data any) error

func (*Sse[T]) Done

func (s *Sse[T]) Done() <-chan struct{}

func (*Sse[T]) Flush

func (s *Sse[T]) Flush()

func (*Sse[T]) IsClose

func (s *Sse[T]) IsClose() bool

func (*Sse[T]) Json

func (s *Sse[T]) Json(data any) error

func (*Sse[T]) String

func (s *Sse[T]) String(data string) error

func (*Sse[T]) Wait

func (s *Sse[T]) Wait() error

type SseConfig

type SseConfig struct {
	Retry time.Duration
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func (*Store) Add

func (s *Store) Add(key string, value []string)

func (*Store) All

func (s *Store) All(key string) Values

func (*Store) Empty

func (s *Store) Empty(key string) bool

func (*Store) First

func (s *Store) First(key string) Value

func (*Store) Has

func (s *Store) Has(key string) bool

func (*Store) Index

func (s *Store) Index(key string, index int) Value

func (*Store) Keys

func (s *Store) Keys() []string

func (*Store) Remove

func (s *Store) Remove(key string)

func (*Store) String

func (s *Store) String() string

func (*Store) Struct

func (s *Store) Struct(input any)

func (*Store) Values

func (s *Store) Values() [][]string

type Stream

type Stream[T Packer] struct {
	Time time.Time

	Response http.ResponseWriter
	Request  *http.Request

	Query    *Store
	Form     *Store
	Files    *Files
	Json     *Json
	Protobuf *Protobuf

	Params  socket.Params
	Context kitty.Context
	Logger  kitty.Logger

	Sender *Sender

	Parser *Parser[T]
	// contains filtered or unexported fields
}

func NewStream

func NewStream[T Packer](conn T, w http.ResponseWriter, r *http.Request) *Stream[T]

func (*Stream[T]) AutoGet

func (s *Stream[T]) AutoGet(key string) Value

func (*Stream[T]) ClientIP

func (s *Stream[T]) ClientIP() string

func (*Stream) Conn

func (s *Stream) Conn() T

func (*Stream[T]) Empty

func (s *Stream[T]) Empty(key string) bool

func (*Stream[T]) Forward

func (s *Stream[T]) Forward(fn func(stream *Stream[T]) error) error

func (*Stream[T]) Has

func (s *Stream[T]) Has(key string) bool

func (*Stream[T]) Host

func (s *Stream[T]) Host() string

func (*Stream[T]) Scheme

func (s *Stream[T]) Scheme() string

func (*Stream[T]) SetHeader

func (s *Stream[T]) SetHeader(header string, content string)

func (*Stream[T]) String

func (s *Stream[T]) String() string

func (*Stream[T]) UpgradeSse

func (s *Stream[T]) UpgradeSse(config *SseConfig) (*Sse[T], error)

func (*Stream[T]) Url

func (s *Stream[T]) Url() string

type Validator

type Validator interface {
}

type Value

type Value struct {
	// contains filtered or unexported fields
}

func (Value) Bool

func (v Value) Bool() bool

func (Value) Bytes

func (v Value) Bytes() []byte

func (Value) Float64

func (v Value) Float64() float64

func (Value) Int

func (v Value) Int() int

func (Value) Int64

func (v Value) Int64() int64

func (Value) String

func (v Value) String() string

type Values

type Values []string

func (Values) Bool

func (v Values) Bool() []bool

func (Values) Bytes

func (v Values) Bytes() [][]byte

func (Values) Float64

func (v Values) Float64() []float64

func (Values) Int

func (v Values) Int() []int

func (Values) Int64

func (v Values) Int64() []int64

func (Values) String

func (v Values) String() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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