cache

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachePlugin

type CachePlugin struct {
	plugin.NetRPCUnsupportedPlugin

	Impl CacheService
}

func (*CachePlugin) Client

func (p *CachePlugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*CachePlugin) Server

func (p *CachePlugin) Server(*plugin.MuxBroker) (interface{}, error)

type CacheService

type CacheService interface {
	Setup(setup *Setup) error

	SetCache(r *SetCacheRequest) (*SetCacheResponse, error)

	GetCache(r *GetCacheRequest) (*GetCacheResponse, error)

	DeleteCache(r *DeleteCacheRequest) (*DeleteCacheResponse, error)
}

type DefaultService

type DefaultService struct{}

func (*DefaultService) DeleteCache

func (*DefaultService) GetCache

func (*DefaultService) SetCache

func (*DefaultService) Setup

func (s *DefaultService) Setup(setup setup.Setup) error

type DeleteCacheRequest

type DeleteCacheRequest struct {
	Key string `json:"key"`
}

type DeleteCacheResponse

type DeleteCacheResponse struct {
	Success bool `json:"success"`
}

type GetCacheRequest

type GetCacheRequest struct {
	Key string `json:"key"`
}

type GetCacheResponse

type GetCacheResponse struct {
	Value []byte `json:"value"`
}

type RpcClient

type RpcClient struct {
	// contains filtered or unexported fields
}

func (*RpcClient) DeleteCache

func (c *RpcClient) DeleteCache(req *DeleteCacheRequest) (*DeleteCacheResponse, error)

func (*RpcClient) GetCache

func (c *RpcClient) GetCache(req *GetCacheRequest) (*GetCacheResponse, error)

func (*RpcClient) SetCache

func (c *RpcClient) SetCache(req *SetCacheRequest) (*SetCacheResponse, error)

func (*RpcClient) Setup

func (c *RpcClient) Setup(req *Setup) error

type RpcServer

type RpcServer struct {
	// contains filtered or unexported fields
}

func (*RpcServer) DeleteCache

func (s *RpcServer) DeleteCache(req *DeleteCacheRequest, resp *DeleteCacheResponse) error

func (*RpcServer) GetCache

func (s *RpcServer) GetCache(req *GetCacheRequest, resp *GetCacheResponse) error

func (*RpcServer) SetCache

func (s *RpcServer) SetCache(req *SetCacheRequest, resp *SetCacheResponse) error

func (*RpcServer) Setup

func (s *RpcServer) Setup(req *Setup, resp *error) error

type SetCacheRequest

type SetCacheRequest struct {
	Key   string `json:"key"`
	Value []byte `json:"value"`
	TTL   int64  `json:"ttl,omitempty"`
}

type SetCacheResponse

type SetCacheResponse struct {
	Success bool `json:"success"`
}

type Setup

type Setup struct {
	Data map[string]interface{}
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL