Documentation ¶
Index ¶
- func Register(name string, handler storageHandler) (err error)
- func Use(name string) (handler storageHandler, err error)
- type FileHandler
- func (this *FileHandler) DelContent(key string) (err error)
- func (this *FileHandler) GetContent(key string) (content []byte, err error)
- func (this *FileHandler) Initiate(ctx context.Context, conf *config.Instance) (err error)
- func (this *FileHandler) SetContent(key string, content []byte) (err error)
- type Handler
- type Instance
- func (this *Instance) DelContent(key string) (err error)
- func (this *Instance) GetContent(key string) (content []byte, err error)
- func (this *Instance) Initiate(ctx context.Context) (newCtx context.Context, err error)
- func (this *Instance) OnRequestShutdown(ctx context.Context, c *routing.Context) (context.Context, error)
- func (this *Instance) OnRequestStartup(ctx context.Context, c *routing.Context) (context.Context, error)
- func (this *Instance) OnShutdown(ctx context.Context) (context.Context, error)
- func (this *Instance) OnStartup(ctx context.Context) (newCtx context.Context, err error)
- func (this *Instance) SetContent(key string, content []byte) (err error)
- func (this *Instance) Use(ctx context.Context, handlerName string) (err error)
- type LRUFileHandler
- func (this *LRUFileHandler) DelContent(key string) (err error)
- func (this *LRUFileHandler) GetContent(key string) (content []byte, err error)
- func (this *LRUFileHandler) Initiate(ctx context.Context, conf *config.Instance) (err error)
- func (this *LRUFileHandler) SetContent(key string, content []byte) (err error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileHandler ¶
type FileHandler struct {
// contains filtered or unexported fields
}
Example ¶
handler.SetContent("1", []byte{1, 2, 3}) fmt.Println(handler.GetContent("1"))
Output: [1 2 3] <nil>
func (*FileHandler) DelContent ¶
func (this *FileHandler) DelContent(key string) (err error)
func (*FileHandler) GetContent ¶
func (this *FileHandler) GetContent(key string) (content []byte, err error)
func (*FileHandler) SetContent ¶
func (this *FileHandler) SetContent(key string, content []byte) (err error)
type Handler ¶
type Handler interface { Initiate(ctx context.Context, conf *config.Instance) error SetContent(key string, content []byte) (err error) GetContent(key string) (content []byte, err error) DelContent(key string) (err error) }
func NewFileHandler ¶
func NewFileHandler() Handler
func NewLRUFileHandler ¶
func NewLRUFileHandler() Handler
type Instance ¶
func NewInstance ¶
func NewInstance() *Instance
func (*Instance) DelContent ¶
func (*Instance) GetContent ¶
func (*Instance) OnRequestShutdown ¶
func (*Instance) OnRequestStartup ¶
func (*Instance) OnShutdown ¶
func (*Instance) SetContent ¶
type LRUFileHandler ¶
type LRUFileHandler struct {
// contains filtered or unexported fields
}
func (*LRUFileHandler) DelContent ¶
func (this *LRUFileHandler) DelContent(key string) (err error)
func (*LRUFileHandler) GetContent ¶
func (this *LRUFileHandler) GetContent(key string) (content []byte, err error)
func (*LRUFileHandler) SetContent ¶
func (this *LRUFileHandler) SetContent(key string, content []byte) (err error)
Click to show internal directories.
Click to hide internal directories.