kit

package
v0.2.1-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MPL-2.0 Imports: 19 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient() *http.Client

TODO

Types

type ContextKey

type ContextKey string
const (
	ContextKeyReq ContextKey = "req"
)

type EventHandlerFunc

type EventHandlerFunc func(kit Kontext) error

type Kit

type Kit interface {
	Start()
	Route(string, EventHandlerFunc)
	Default(EventHandlerFunc)
	Log() *logkf.Logger
}

func New

func New() Kit

type KitRoundTripper

type KitRoundTripper struct{}

func (*KitRoundTripper) Do

func (rt *KitRoundTripper) Do(httpReq *http.Request) (*http.Response, error)

func (*KitRoundTripper) RoundTrip

func (rt *KitRoundTripper) RoundTrip(httpReq *http.Request) (*http.Response, error)

type Kontext

type Kontext interface {
	kubefox.EventReader

	Env(name string) string
	EnvV(name string) *kubefox.Val
	EnvDef(name string, def string) string

	Resp() Resp

	Component(name string) Req

	Context() context.Context
	Log() *logkf.Logger
}

type Req

type Req interface {
	kubefox.EventWriter

	SendStr(s string) (kubefox.EventReader, error)
	SendHTML(h string) (kubefox.EventReader, error)
	SendJSON(v any) (kubefox.EventReader, error)
	SendBytes(contentType string, b []byte) (kubefox.EventReader, error)
	Send() (kubefox.EventReader, error)
}

type Resp

type Resp interface {
	kubefox.EventWriter

	SendStr(s string) error
	SendHTML(h string) error
	SendJSON(v any) error
	SendBytes(contentType string, b []byte) error
	Send() error
}

Jump to

Keyboard shortcuts

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