Versions in this module Expand all Collapse all v0 v0.0.2 Apr 22, 2021 Changes in this version + const AcceptEncoding + const ContentEncoding + const ContentType + const XContentTypeOptions + var Base64 = base64_ + var Compress compress_ + var Crypto crypto_ + var Dir dir_ + var Graphics graphics_ + var HTTP http_ + var Log log_ + var Prometheus prometheus_ + var Redis redis_ + var Ristretto ristretto_ + var SMTP smtp_ + var SQL sql_ + var Template template + func NewErrors(errs ...error) errorList + type AESGCM struct + func (x *AESGCM) Open(ciphertext []byte) (plaintext []byte, err error) + func (x *AESGCM) Seal(plaintext []byte) (ciphertext []byte) + type Base64Wrapper struct + func (x Base64Wrapper) AtoB(b []byte) []byte + func (x Base64Wrapper) BtoA(b []byte) []byte + type Brotli struct + func (x *Brotli) Read(dst io.Writer, src io.Reader) (err error) + func (x *Brotli) Write(dst io.Writer, src io.Reader) (err error) + type Client struct + type ConsoleWriter = zerolog.ConsoleWriter + type CryptoWrapper struct + func (*CryptoWrapper) Argon2I(password []byte) []byte + func (*CryptoWrapper) Argon2ICompareHashAndPassword(hashed, password []byte) bool + func (*CryptoWrapper) Argon2ID(password []byte) []byte + func (*CryptoWrapper) Argon2IDCompareHashAndPassword(hashed, password []byte) bool + func (*CryptoWrapper) BCrypt(password []byte) []byte + func (*CryptoWrapper) BCryptCompareHashAndPassword(hashed, password []byte) bool + func (*CryptoWrapper) NewAESGCM(password []byte) *AESGCM + func (*CryptoWrapper) NewECDSA(curv elliptic.Curve) (*ECDSA, error) + func (*CryptoWrapper) NewNaCl() *NaCl + func (*CryptoWrapper) NewRSA(bits int) (*RSA, error) + func (*CryptoWrapper) NewTLSConfig(certFile, keyFile, dirCache string, hostWhitelist ...string) *tls.Config + func (*CryptoWrapper) Nonce(length int) []byte + func (*CryptoWrapper) ReadECDSA(key, pub io.Reader) (*ECDSA, error) + func (*CryptoWrapper) ReadRSA(key, pub io.Reader) (*RSA, error) + func (*CryptoWrapper) SCrypt(password []byte) []byte + func (*CryptoWrapper) SCryptCompareHashAndPassword(hashed, password []byte) bool + func (*CryptoWrapper) SHA256(b []byte) []byte + func (*CryptoWrapper) SHA512(b []byte) []byte + type DirConfig struct + Path string + type DirWrapper struct + func (x *DirWrapper) Dirs() []*DirWrapper + func (x *DirWrapper) Files() []*os.File + func (x *DirWrapper) FilesInfo() []os.FileInfo + func (x *DirWrapper) Filter(filter FilterFunc) *DirWrapper + func (x *DirWrapper) Walk(next string) *DirWrapper + type ECDSA struct + func (x *ECDSA) Sign(h []byte) (r, s *big.Int, err error) + func (x *ECDSA) SignASN1(h []byte) ([]byte, error) + func (x *ECDSA) Verify(h []byte, r, s *big.Int) bool + func (x *ECDSA) VerifyASN1(h, sig []byte) bool + func (x *ECDSA) Write(key, pub io.Writer) (err error) + type FilterFunc func(i int, f os.FileInfo, fs []os.FileInfo) bool + type Flate struct + func (x *Flate) Read(dst io.Writer, src io.Reader) (err error) + func (x *Flate) Write(dst io.Writer, src io.Reader) (err error) + type GraphicsConfig struct + GIF *gif.Options + JPEG *jpeg.Options + TIFF *tiff.Options + type GraphicsWrapper struct + func (x *GraphicsWrapper) Blur(dst io.Writer, src io.Reader, stdDev float64, size int) (err error) + func (x *GraphicsWrapper) Decode(src io.Reader) (img image.Image, format string, err error) + func (x *GraphicsWrapper) DecodeConfig(src io.Reader) (conf image.Config, format string, err error) + func (x *GraphicsWrapper) Encode(dst io.Writer, img image.Image, format string) (err error) + func (x *GraphicsWrapper) Rect(x0, y0, x1, y1 int) image.Rectangle + func (x *GraphicsWrapper) Rotate(dst io.Writer, src io.Reader, angle float64) (err error) + func (x *GraphicsWrapper) Scale(dst io.Writer, src io.Reader, w, h int) (err error) + func (x *GraphicsWrapper) SubImage(img image.Image, rect image.Rectangle) (sub image.Image) + func (x *GraphicsWrapper) Thumbnail(dst io.Writer, src io.Reader, w, h int) (err error) + type Gzip struct + func (x *Gzip) Read(dst io.Writer, src io.Reader) (err error) + func (x *Gzip) Write(dst io.Writer, src io.Reader) (err error) + type HTMLTemplateWrapper struct + func (x *HTMLTemplateWrapper) Execute(w io.Writer, key string, data interface{}) error + func (x *HTMLTemplateWrapper) Parse(r ...io.Reader) error + type HTTPClientMock struct + func (x *HTTPClientMock) Expect(method, pattern string, handler http.Handler) + func (x *HTTPClientMock) URL(path string) string + type HTTPClientTrace = httptrace.ClientTrace + type HTTPClientWrapper struct + type HTTPMux struct + NotFoundHandler http.Handler + PanicHandler http.Handler + func (m *HTTPMux) GoString() string + func (m *HTTPMux) Handle(method string, pattern string, next http.Handler) *HTTPMux + func (m *HTTPMux) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (m *HTTPMux) With(next http.Handler, matcher HTTPMuxMatcher) *HTTPMux + type HTTPMuxMatcher interface + Match func(*http.Request) bool + Priority func() float64 + Test func() bool + type HTTPReverseProxy = httputil.ReverseProxy + type HTTPServerWrapper struct + func (x HTTPServerWrapper) Run(onInfo func(string), onError func(error), shutdownTimeout time.Duration) error + type HTTPTransportWrapper struct + func (x HTTPTransportWrapper) DumpOnRequest(dst io.Writer, includeBody bool) HTTPTransportWrapper + func (x HTTPTransportWrapper) DumpOnResponse(dst io.Writer, includeBody bool) HTTPTransportWrapper + func (x HTTPTransportWrapper) OnRequest(v func(*http.Request) error) HTTPTransportWrapper + func (x HTTPTransportWrapper) OnResponse(v func(*http.Response) error) HTTPTransportWrapper + func (x HTTPTransportWrapper) RoundTrip(req *http.Request) (res *http.Response, err error) + func (x HTTPTransportWrapper) WithBase(v http.RoundTripper) HTTPTransportWrapper + func (x HTTPTransportWrapper) WithTrace(v *HTTPClientTrace) HTTPTransportWrapper + type LogConfig struct + Flag int + Prefix string + func (c *LogConfig) ConsoleWriter(cw *ConsoleWriter) *LogConfig + func (c *LogConfig) MultiWriter(w ...io.Writer) *LogConfig + type LogWrapper struct + func (x *LogWrapper) UseErrorStackMarshaler(use bool) *LogWrapper + func (x *LogWrapper) Z(levelStr string) *zerolog.Event + type Minify struct + func (x *Minify) WithMediaType(mediatype string) *Minify + func (x *Minify) Write(dst io.Writer, src io.Reader) (err error) + type NaCl struct + func (*NaCl) AuthSum(message []byte, secretKey *[32]byte) []byte + func (*NaCl) AuthVerify(digest []byte, message []byte, secretKey *[32]byte) bool + func (*NaCl) BoxKeyPair() (publicKey, privateKey *[32]byte, err error) + func (*NaCl) BoxOpen(box_ []byte, peersPublicKey, privateKey *[32]byte) ([]byte, bool) + func (*NaCl) BoxOpenAfterPrecomputation(box_ []byte, sharedKey *[32]byte) ([]byte, bool) + func (*NaCl) BoxOpenAnonymous(box_ []byte, publicKey, privateKey *[32]byte) (message []byte, ok bool) + func (*NaCl) BoxPrecompute(peersPublicKey, privateKey *[32]byte) (sharedKey *[32]byte) + func (*NaCl) BoxSeal(message []byte, peersPublicKey, privateKey *[32]byte) []byte + func (*NaCl) BoxSealAfterPrecomputation(message []byte, sharedKey *[32]byte) []byte + func (*NaCl) BoxSealAnonymous(message []byte, recipient *[32]byte) ([]byte, error) + func (*NaCl) SecretBoxOpen(box_ []byte, key *[32]byte) ([]byte, bool) + func (*NaCl) SecretBoxSeal(message []byte, key *[32]byte) []byte + func (*NaCl) Sign(message []byte, privateKey *[64]byte) []byte + func (*NaCl) SignKeyPair() (publicKey *[32]byte, privateKey *[64]byte, err error) + func (*NaCl) SignOpen(signedMessage []byte, publicKey *[32]byte) ([]byte, bool) + type NetSMTPMock struct + func (x *NetSMTPMock) WithNetDialer(netDialer NetDialer) + func (x *NetSMTPMock) WithNetResolver(netResolver NetResolver) + func (x *NetSMTPMock) WithNewSmtpClient(client SmtpClient, err error) + func (x *NetSMTPMock) WithSendMail(err error) + type NetSMTPWrapper struct + func (x *NetSMTPWrapper) ReverseLookup(ctx context.Context, from, to mail.Address) (err error) + func (x *NetSMTPWrapper) SendMail(ctx context.Context, id string, from, to mail.Address, subject string, ...) error + type PrometheusConfig struct + Namespace string + Subsystem string + type PrometheusMock struct + func (p *PrometheusMock) CollectAndCompare(c prometheus.Collector, expected io.Reader, metricNames ...string) error + func (p *PrometheusMock) CollectAndCount(c prometheus.Collector, metricNames ...string) int + func (p *PrometheusMock) CollectAndLint(c prometheus.Collector, metricNames ...string) ([]promlint.Problem, error) + func (p *PrometheusMock) ToFloat64(c prometheus.Collector) float64 + type PrometheusWrapper struct + func (p *PrometheusWrapper) CounterVec(name, help string, labelNames ...string) *prometheus.CounterVec + func (p *PrometheusWrapper) GaugeVec(name, help string, labelNames ...string) *prometheus.GaugeVec + func (p *PrometheusWrapper) HistogramVec(name, help string, labelNames ...string) *prometheus.HistogramVec + func (p *PrometheusWrapper) SummaryVec(name, help string, labelNames ...string) *prometheus.SummaryVec + type RSA struct + func (x *RSA) DecryptOAEP(ciphertext, label []byte) ([]byte, error) + func (x *RSA) DecryptPKCS1v15(ciphertext []byte) ([]byte, error) + func (x *RSA) EncryptOAEP(msg, label []byte) ([]byte, error) + func (x *RSA) EncryptPKCS1v15(msg []byte) ([]byte, error) + func (x *RSA) Write(key, pub io.Writer) (err error) + type RedisConfig = redis.UniversalOptions + type RedisMock struct + type RedisWrapper struct + type RistrettoCacheI interface + Clear func() + Close func() + Del func(key interface{}) + Get func(key interface{}) (interface{}, bool) + Set func(key, value interface{}, cost int64) bool + SetWithTTL func(key, value interface{}, cost int64, ttl time.Duration) bool + type RistrettoCacheMetricsI interface + Clear func() + CostAdded func() uint64 + CostEvicted func() uint64 + GetsDropped func() uint64 + GetsKept func() uint64 + Hits func() uint64 + KeysAdded func() uint64 + KeysEvicted func() uint64 + KeysUpdated func() uint64 + Misses func() uint64 + Ratio func() float64 + SetsDropped func() uint64 + SetsRejected func() uint64 + String func() string + type RistrettoConfig = ristretto.Config + type RistrettoWrapper struct + type SMTPConfig struct + Addr string + CRAMMD5AuthSecret string + CRAMMD5AuthUsername string + PlainAuthIdentity string + PlainAuthPassword string + PlainAuthUsername string + type SQLConfig struct + ConnMaxIdleTime time.Duration + ConnMaxLifetime time.Duration + DataSourceName string + DriverName string + MaxIdleConns int + MaxOpenConns int + type SQLMock struct + func (m SQLMock) NewResult(lastInsertId int64, lastInsertIdError error, rowsAffected int64, ...) sql.Result + func (m SQLMock) NewRows(columns ...string) *sqlmock.Rows + type SQLResultExec struct + type SQLResultQuery []Dict + type SQLResultQueryRow Dict + type SQLStatement struct + func (s SQLStatement) Exec(ctx context.Context, args ...interface{}) (res SQLResultExec, err error) + func (s SQLStatement) Query(ctx context.Context, args ...interface{}) (rows SQLResultQuery, err error) + func (s SQLStatement) QueryRow(ctx context.Context, args ...interface{}) (row SQLResultQueryRow, err error) + type SQLWrapper struct + func (s *SQLWrapper) Done(tx *sql.Tx, err error) error + func (s *SQLWrapper) Statement(ctx context.Context, tx *sql.Tx, q string) SQLStatement + type TextTemplateWrapper struct + func (x *TextTemplateWrapper) Execute(w io.Writer, key string, data interface{}) error + func (x *TextTemplateWrapper) Parse(r ...io.Reader) error v0.0.1 Mar 17, 2021 Changes in this version + var JSON jsoniter.API = jsoniter.ConfigFastest + func ListenToSignal(sigs ...os.Signal) os.Signal + func PanicWhen(condition bool, v interface{}) + func Parallel(ctx context.Context, chanErr chan<- error, tasks ...func() error) + func ParseDuration(s string, fallback time.Duration) (d time.Duration) + func RecoverWith(catch func(recv interface{})) + func ShouldCover(code int, required float64) int + type CSS = html.CSS + type Currency struct + Format string + Tag string + Value float64 + func (c Currency) MarshalJSON() ([]byte, error) + func (c Currency) String() string + type Dict map[string]interface + func (d *Dict) Delete(k string) + func (d *Dict) Map(fn func(k string, v interface{})) + func (d *Dict) Set(k string, v interface{}) + type Error struct + Err error + func NewError(format string, a ...interface{}) Error + func (e *Error) MarshalJSON() (b []byte, err error) + func (e *Error) UnmarshalJSON(b []byte) (err error) + func (e Error) As(target interface{}) bool + func (e Error) Error() string + func (e Error) Is(target error) bool + func (e Error) Unwrap() error + type Errors []Error + func (e *Errors) UnmarshalJSON(b []byte) error + func (e Errors) Append(errs ...error) Errors + func (e Errors) Error() string + func (e Errors) MarshalJSON() ([]byte, error) + type FsFileInfo interface + type HTML = html.HTML + type HTMLAttr = html.HTMLAttr + type JS = html.JS + type JSStr = html.JSStr + type List []interface + func (l *List) Add(v interface{}) + func (l *List) Delete(k int) + func (l *List) Map(fn func(k int, v interface{})) + type MockFsFileInfo struct + func NewMockFsFileInfo(ctrl *gomock.Controller) *MockFsFileInfo + func (m *MockFsFileInfo) EXPECT() *MockFsFileInfoMockRecorder + func (m *MockFsFileInfo) IsDir() bool + func (m *MockFsFileInfo) ModTime() time.Time + func (m *MockFsFileInfo) Mode() fs.FileMode + func (m *MockFsFileInfo) Name() string + func (m *MockFsFileInfo) Size() int64 + func (m *MockFsFileInfo) Sys() interface{} + type MockFsFileInfoMockRecorder struct + func (mr *MockFsFileInfoMockRecorder) IsDir() *gomock.Call + func (mr *MockFsFileInfoMockRecorder) ModTime() *gomock.Call + func (mr *MockFsFileInfoMockRecorder) Mode() *gomock.Call + func (mr *MockFsFileInfoMockRecorder) Name() *gomock.Call + func (mr *MockFsFileInfoMockRecorder) Size() *gomock.Call + func (mr *MockFsFileInfoMockRecorder) Sys() *gomock.Call + type MockNetAddr struct + func NewMockNetAddr(ctrl *gomock.Controller) *MockNetAddr + func (m *MockNetAddr) EXPECT() *MockNetAddrMockRecorder + func (m *MockNetAddr) Network() string + func (m *MockNetAddr) String() string + type MockNetAddrMockRecorder struct + func (mr *MockNetAddrMockRecorder) Network() *gomock.Call + func (mr *MockNetAddrMockRecorder) String() *gomock.Call + type MockNetConn struct + func NewMockNetConn(ctrl *gomock.Controller) *MockNetConn + func (m *MockNetConn) Close() error + func (m *MockNetConn) EXPECT() *MockNetConnMockRecorder + func (m *MockNetConn) LocalAddr() net.Addr + func (m *MockNetConn) Read(b []byte) (int, error) + func (m *MockNetConn) RemoteAddr() net.Addr + func (m *MockNetConn) SetDeadline(t time.Time) error + func (m *MockNetConn) SetReadDeadline(t time.Time) error + func (m *MockNetConn) SetWriteDeadline(t time.Time) error + func (m *MockNetConn) Write(b []byte) (int, error) + type MockNetConnMockRecorder struct + func (mr *MockNetConnMockRecorder) Close() *gomock.Call + func (mr *MockNetConnMockRecorder) LocalAddr() *gomock.Call + func (mr *MockNetConnMockRecorder) Read(b interface{}) *gomock.Call + func (mr *MockNetConnMockRecorder) RemoteAddr() *gomock.Call + func (mr *MockNetConnMockRecorder) SetDeadline(t interface{}) *gomock.Call + func (mr *MockNetConnMockRecorder) SetReadDeadline(t interface{}) *gomock.Call + func (mr *MockNetConnMockRecorder) SetWriteDeadline(t interface{}) *gomock.Call + func (mr *MockNetConnMockRecorder) Write(b interface{}) *gomock.Call + type MockNetDialer struct + func NewMockNetDialer(ctrl *gomock.Controller) *MockNetDialer + func (m *MockNetDialer) Dial(network, address string) (net.Conn, error) + func (m *MockNetDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) + func (m *MockNetDialer) EXPECT() *MockNetDialerMockRecorder + type MockNetDialerMockRecorder struct + func (mr *MockNetDialerMockRecorder) Dial(network, address interface{}) *gomock.Call + func (mr *MockNetDialerMockRecorder) DialContext(ctx, network, address interface{}) *gomock.Call + type MockNetResolver struct + func NewMockNetResolver(ctrl *gomock.Controller) *MockNetResolver + func (m *MockNetResolver) EXPECT() *MockNetResolverMockRecorder + func (m *MockNetResolver) LookupAddr(ctx context.Context, addr string) ([]string, error) + func (m *MockNetResolver) LookupCNAME(ctx context.Context, host string) (string, error) + func (m *MockNetResolver) LookupHost(ctx context.Context, host string) ([]string, error) + func (m *MockNetResolver) LookupIP(ctx context.Context, network, host string) ([]net.IP, error) + func (m *MockNetResolver) LookupIPAddr(ctx context.Context, host string) ([]net.IPAddr, error) + func (m *MockNetResolver) LookupMX(ctx context.Context, name string) ([]*net.MX, error) + func (m *MockNetResolver) LookupNS(ctx context.Context, name string) ([]*net.NS, error) + func (m *MockNetResolver) LookupPort(ctx context.Context, network, service string) (int, error) + func (m *MockNetResolver) LookupSRV(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) + func (m *MockNetResolver) LookupTXT(ctx context.Context, name string) ([]string, error) + type MockNetResolverMockRecorder struct + func (mr *MockNetResolverMockRecorder) LookupAddr(ctx, addr interface{}) *gomock.Call + func (mr *MockNetResolverMockRecorder) LookupCNAME(ctx, host interface{}) *gomock.Call + func (mr *MockNetResolverMockRecorder) LookupHost(ctx, host interface{}) *gomock.Call + func (mr *MockNetResolverMockRecorder) LookupIP(ctx, network, host interface{}) *gomock.Call + func (mr *MockNetResolverMockRecorder) LookupIPAddr(ctx, host interface{}) *gomock.Call + func (mr *MockNetResolverMockRecorder) LookupMX(ctx, name interface{}) *gomock.Call + func (mr *MockNetResolverMockRecorder) LookupNS(ctx, name interface{}) *gomock.Call + func (mr *MockNetResolverMockRecorder) LookupPort(ctx, network, service interface{}) *gomock.Call + func (mr *MockNetResolverMockRecorder) LookupSRV(ctx, service, proto, name interface{}) *gomock.Call + func (mr *MockNetResolverMockRecorder) LookupTXT(ctx, name interface{}) *gomock.Call + type MockSmtpClient struct + func NewMockSmtpClient(ctrl *gomock.Controller) *MockSmtpClient + func (m *MockSmtpClient) Auth(a smtp.Auth) error + func (m *MockSmtpClient) Close() error + func (m *MockSmtpClient) Data() (io.WriteCloser, error) + func (m *MockSmtpClient) EXPECT() *MockSmtpClientMockRecorder + func (m *MockSmtpClient) Extension(ext string) (bool, string) + func (m *MockSmtpClient) Hello(localName string) error + func (m *MockSmtpClient) Mail(from string) error + func (m *MockSmtpClient) Noop() error + func (m *MockSmtpClient) Quit() error + func (m *MockSmtpClient) Rcpt(to string) error + func (m *MockSmtpClient) Reset() error + func (m *MockSmtpClient) StartTLS(config *tls.Config) error + func (m *MockSmtpClient) TLSConnectionState() (tls.ConnectionState, bool) + func (m *MockSmtpClient) Verify(addr string) error + type MockSmtpClientMockRecorder struct + func (mr *MockSmtpClientMockRecorder) Auth(a interface{}) *gomock.Call + func (mr *MockSmtpClientMockRecorder) Close() *gomock.Call + func (mr *MockSmtpClientMockRecorder) Data() *gomock.Call + func (mr *MockSmtpClientMockRecorder) Extension(ext interface{}) *gomock.Call + func (mr *MockSmtpClientMockRecorder) Hello(localName interface{}) *gomock.Call + func (mr *MockSmtpClientMockRecorder) Mail(from interface{}) *gomock.Call + func (mr *MockSmtpClientMockRecorder) Noop() *gomock.Call + func (mr *MockSmtpClientMockRecorder) Quit() *gomock.Call + func (mr *MockSmtpClientMockRecorder) Rcpt(to interface{}) *gomock.Call + func (mr *MockSmtpClientMockRecorder) Reset() *gomock.Call + func (mr *MockSmtpClientMockRecorder) StartTLS(config interface{}) *gomock.Call + func (mr *MockSmtpClientMockRecorder) TLSConnectionState() *gomock.Call + func (mr *MockSmtpClientMockRecorder) Verify(addr interface{}) *gomock.Call + type NetAddr interface + type NetConn interface + type NetDialer interface + Dial func(network, address string) (net.Conn, error) + DialContext func(ctx context.Context, network, address string) (net.Conn, error) + type NetResolver interface + LookupAddr func(ctx context.Context, addr string) (names []string, err error) + LookupCNAME func(ctx context.Context, host string) (cname string, err error) + LookupHost func(ctx context.Context, host string) (addrs []string, err error) + LookupIP func(ctx context.Context, network, host string) ([]net.IP, error) + LookupIPAddr func(ctx context.Context, host string) ([]net.IPAddr, error) + LookupMX func(ctx context.Context, name string) ([]*net.MX, error) + LookupNS func(ctx context.Context, name string) ([]*net.NS, error) + LookupPort func(ctx context.Context, network, service string) (port int, err error) + LookupSRV func(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error) + LookupTXT func(ctx context.Context, name string) ([]string, error) + type SmtpClient interface + Auth func(a smtp.Auth) error + Close func() error + Data func() (io.WriteCloser, error) + Extension func(ext string) (bool, string) + Hello func(localName string) error + Mail func(from string) error + Noop func() error + Quit func() error + Rcpt func(to string) error + Reset func() error + StartTLS func(config *tls.Config) error + TLSConnectionState func() (state tls.ConnectionState, ok bool) + Verify func(addr string) error + type Srcset = html.Srcset + type URL = html.URL