Documentation
¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Del(ctx context.Context, key string) (rErr error)
- func (c *Client) DeleteExpired(ctx context.Context) error
- func (c *Client) Get(ctx context.Context, key string) (_ string, rErr error)
- func (c *Client) Set(ctx context.Context, key string, value any, expiration time.Duration) (rErr error)
- func (c *Client) StartCleanup(ctx context.Context, interval time.Duration)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client はSQLiteを使ったキーバリューストアの実装。 外部サービス不要で動作する。
func NewClient ¶
NewClient は指定されたファイルパスにSQLiteデータベースを開き、Clientを返す。 path に ":memory:" を指定するとインメモリDBとして動作する。
func (*Client) DeleteExpired ¶
DeleteExpired は期限切れのレコードをすべて削除する。
Click to show internal directories.
Click to hide internal directories.