Documentation ¶
Index ¶
- func Checksum[T any](v T) string
- func FiniteValueChannel[T any](val ...T) <-chan T
- func Json[T any](src *T, sink io.Writer) error
- func Must[T any](v T, err error) T
- func RandUint64(n uint64) uint64
- func ToPtr[T any](v T) *T
- func Zstd[T any](src *T, sink io.Writer) error
- type HandlerFunc
- type StreamingHandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FiniteValueChannel ¶
func FiniteValueChannel[T any](val ...T) <-chan T
FiniteValueChannel returns a new read-only buffered channel with all the provided values already pushed into it. The channel returned is closed and allows no further writes.
func RandUint64 ¶
RandUint64 returns a secure-random uint64 value generated using crypto/rand
Types ¶
type HandlerFunc ¶
HandlerFunc takes care of boilerplate details around handling requests and responses.
func (HandlerFunc[I, O]) ServeHTTP ¶
func (h HandlerFunc[I, O]) ServeHTTP(res http.ResponseWriter, req *http.Request)
type StreamingHandlerFunc ¶
StreamingHandlerFunc takes care of boilerplate details around handling requests where responses can be sent as a stream of 0 or more objects. It exposes the http.ResponseWriter to the implementer.
func (StreamingHandlerFunc[I]) ServeHTTP ¶
func (h StreamingHandlerFunc[I]) ServeHTTP(res http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.