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 CodedCacher ¶ added in v0.0.4
type CodedCacher interface { SimpleCacher // GetAs get and decode cache value to object ptr GetAs(key string, ptr interface{}) 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) interface{} SetWithCtx(ctx context.Context, key string, val interface{}, ttl time.Duration) error // MGetWithCtx multi keys operation MGetWithCtx(ctx context.Context, keys []string) map[string]interface{} MSetWithCtx(ctx context.Context, values map[string]interface{}, ttl time.Duration) error MDelWithCtx(ctx context.Context, keys []string) error }
ContextOpCacher interface.
type DataParser ¶ added in v0.0.8
type DataParser interface { Marshaler Unmarshaler }
DataParser interface for Marshal/Unmarshal data
type GenLogger ¶ added in v0.0.5
type GenLogger interface { Debug(v ...interface{}) Debugf(format string, v ...interface{}) Info(v ...interface{}) Infof(format string, v ...interface{}) Warn(v ...interface{}) Warnf(format string, v ...interface{}) Error(v ...interface{}) Errorf(format string, v ...interface{}) }
GenLogger generic logger interface definition
type MarshalFunc ¶ added in v0.0.6
MarshalFunc define
func (MarshalFunc) Marshal ¶ added in v0.0.6
func (m MarshalFunc) Marshal(v interface{}) ([]byte, error)
Marshal implements the Marshaler
type Printer ¶
type Printer interface { Print(v ...interface{}) Printf(format string, v ...interface{}) Println(v ...interface{}) }
Printer 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) interface{} Set(key string, val interface{}, ttl time.Duration) error // GetMulti multi operation GetMulti(keys []string) map[string]interface{} SetMulti(values map[string]interface{}, ttl time.Duration) error DelMulti(keys []string) error }
SimpleCacher interface definition
type StdLogger ¶
type StdLogger interface { Printer Fatal(v ...interface{}) Fatalf(format string, v ...interface{}) Fatalln(v ...interface{}) Panic(v ...interface{}) Panicf(format string, v ...interface{}) Panicln(v ...interface{}) }
StdLogger interface definition. refer the go "log" package.
type UnmarshalFunc ¶ added in v0.0.6
UnmarshalFunc define
func (UnmarshalFunc) Unmarshal ¶ added in v0.0.6
func (u UnmarshalFunc) Unmarshal(v []byte, ptr interface{}) error
Unmarshal implements the Unmarshaler
type Unmarshaler ¶ added in v0.0.6
Unmarshaler interface
Click to show internal directories.
Click to hide internal directories.