Documentation
¶
Overview ¶
Package gsr is the Go standards recommendations interface definitions.
Source code and other details for the project are available at GitHub:
https://github.com/gookit/gsr
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶ added in v0.1.1
type Codec interface {
Decode(blob []byte, v any) (err error)
Encode(v any) (out []byte, err error)
}
Codec interface definition
type CodedCacher ¶ added in v0.0.4
type CodedCacher interface {
SimpleCacher
// GetAs get and decode cache value to object ptr
GetAs(key string, ptr any) error
}
CodedCacher interface.
type ContextCacher ¶ added in v0.0.5
type ContextCacher interface {
SimpleCacher
// WithContext and clone new cacher
WithContext(ctx context.Context) ContextCacher
}
ContextCacher interface.
type ContextOpCacher ¶ added in v0.0.7
type ContextOpCacher interface {
SimpleCacher
// HasWithCtx basic operation
HasWithCtx(ctx context.Context, key string) bool
DelWithCtx(ctx context.Context, key string) error
GetWithCtx(ctx context.Context, key string) any
SetWithCtx(ctx context.Context, key string, val any, ttl time.Duration) error
// MGetWithCtx multi keys operation
MGetWithCtx(ctx context.Context, keys []string) map[string]any
MSetWithCtx(ctx context.Context, values map[string]any, ttl time.Duration) error
MDelWithCtx(ctx context.Context, keys []string) error
}
ContextOpCacher interface.
type DecodeFunc ¶ added in v0.1.1
DecodeFunc definition
type EncodeFunc ¶ added in v0.1.1
EncodeFunc definition
type GenLogger ¶ added in v0.0.5
type GenLogger interface {
Debug(v ...any)
Debugf(format string, v ...any)
Info(v ...any)
Infof(format string, v ...any)
Warn(v ...any)
Warnf(format string, v ...any)
Error(v ...any)
Errorf(format string, v ...any)
}
GenLogger generic logger interface definition
type GoSerializer ¶ added in v0.1.1
GoSerializer interface definition
type MarshalFunc ¶ added in v0.0.6
MarshalFunc define
type Serializer ¶ added in v0.1.1
type Serializer interface {
Serialize(v any) ([]byte, error)
Deserialize(data []byte, v any) error
}
Serializer interface definition
type SimpleCacher ¶ added in v0.0.2
type SimpleCacher interface {
// Closer close cache handle
io.Closer
// Clear all cache data
Clear() error
// Has basic operation
Has(key string) bool
Del(key string) error
Get(key string) any
Set(key string, val any, ttl time.Duration) error
// GetMulti multi operation
GetMulti(keys []string) map[string]any
SetMulti(values map[string]any, ttl time.Duration) error
DelMulti(keys []string) error
}
SimpleCacher interface definition
type StdLogger ¶
type StdLogger interface {
Printer
Fatal(v ...any)
Fatalf(format string, v ...any)
Fatalln(v ...any)
Panic(v ...any)
Panicf(format string, v ...any)
Panicln(v ...any)
}
StdLogger interface definition. refer the go "log" package.
type UnmarshalFunc ¶ added in v0.0.6
UnmarshalFunc define
type Unmarshaler ¶ added in v0.0.6
Unmarshaler interface
Click to show internal directories.
Click to hide internal directories.