Documentation ¶
Index ¶
- Constants
- Variables
- func TestStorageAbandon(t *testing.T, s Storage)
- func TestStorageDelete(t *testing.T, s Storage)
- func TestStorageExists(t *testing.T, s Storage)
- func TestStorageGet(t *testing.T, s Storage)
- func TestStorageList(t *testing.T, s Storage)
- func TestStorageListBetween(t *testing.T, s Storage)
- func TestStorageSetValue(t *testing.T, s Storage)
- func TestStorageStart(t *testing.T, s Storage)
- type InstrumentedStorage
- type Storage
Constants ¶
View Source
const ( // DefaultTTL is session time to live default value. DefaultTTL = 24 * time.Minute // DefaultTTC is time to clear default value. DefaultTTC = 1 * time.Minute )
View Source
const ( // EngineInMemory is not implemented yet. EngineInMemory = "in_memory" // EnginePostgres keeps session within postgres database. EnginePostgres = "postgres" // EngineRedis is not implemented yet. EngineRedis = "redis" )
Variables ¶
Functions ¶
func TestStorageAbandon ¶ added in v0.16.0
func TestStorageDelete ¶ added in v0.16.0
func TestStorageExists ¶ added in v0.16.0
func TestStorageGet ¶ added in v0.16.0
func TestStorageList ¶ added in v0.16.0
func TestStorageListBetween ¶ added in v0.16.0
func TestStorageSetValue ¶ added in v0.16.0
func TestStorageStart ¶ added in v0.16.0
Types ¶
type InstrumentedStorage ¶
type InstrumentedStorage interface { Storage prometheus.Collector }
InstrumentedStorage combines Storage and prometheus Collector interface.
type Storage ¶
type Storage interface { Setup() error TearDown() error Start(context.Context, string, string, string, string, map[string]string) (*mnemosynerpc.Session, error) Abandon(context.Context, string) (bool, error) Get(context.Context, string) (*mnemosynerpc.Session, error) List(context.Context, int64, int64, *time.Time, *time.Time) ([]*mnemosynerpc.Session, error) Exists(context.Context, string) (bool, error) Delete(context.Context, string, string, string, *time.Time, *time.Time) (int64, error) SetValue(context.Context, string, string, string) (map[string]string, error) }
Storage combines API that needs to be implemented by any storage to be replaceable.
Click to show internal directories.
Click to hide internal directories.