storage

package
v0.0.0-...-b78b3a4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AESEncryptedStorage

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

AESEncryptedStorage是一种由JSON故障支持的存储类型。json文件包含 密钥值映射,其中密钥没有加密,只有值是加密的。

func NewAESEncryptedStorage

func NewAESEncryptedStorage(filename string, key []byte) *AESEncryptedStorage

newaesEncryptedStorage创建由给定文件/密钥支持的新加密存储

func (*AESEncryptedStorage) Get

func (s *AESEncryptedStorage) Get(key string) string

get返回以前存储的值,如果该值不存在或键的长度为0,则返回空字符串

func (*AESEncryptedStorage) Put

func (s *AESEncryptedStorage) Put(key, value string)

按键存储值。0长度键导致无操作

type EphemeralStorage

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

短暂存储是一种内存存储,它可以 不将值持久化到磁盘。主要用于测试

func (*EphemeralStorage) Get

func (s *EphemeralStorage) Get(key string) string

func (*EphemeralStorage) Put

func (s *EphemeralStorage) Put(key, value string)

type Storage

type Storage interface {
	//按键存储值。0长度键导致无操作
	Put(key, value string)
	//get返回以前存储的值,如果该值不存在或键的长度为0,则返回空字符串
	Get(key string) string
}

func NewEphemeralStorage

func NewEphemeralStorage() Storage

Jump to

Keyboard shortcuts

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