storage

package
v0.0.0-...-4c78285 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/.

Index

Constants

This section is empty.

Variables

View Source
var Keyspace string

Functions

func InitDB

func InitDB(dbType string)

Types

type BoltStorage

type BoltStorage struct {
	Db *bolt.DB
}

func (BoltStorage) BucketExists

func (b BoltStorage) BucketExists(bucket string) bool

func (BoltStorage) CreateBucket

func (b BoltStorage) CreateBucket(bucket string) error

func (BoltStorage) CreateKey

func (b BoltStorage) CreateKey(bucket string, key string, value string, encrypt bool) error

func (BoltStorage) DeleteBucket

func (b BoltStorage) DeleteBucket(bucket string) error

func (BoltStorage) DeleteKey

func (b BoltStorage) DeleteKey(bucket string, key string) error

func (BoltStorage) OpenDB

func (b BoltStorage) OpenDB() (Storage, error)

func (BoltStorage) ReadAllKeys

func (b BoltStorage) ReadAllKeys(bucket string) (map[string]string, error)

func (BoltStorage) ReadKey

func (b BoltStorage) ReadKey(bucket string, key string, encrypted bool) (string, error)

func (BoltStorage) UpdateKey

func (b BoltStorage) UpdateKey(bucket string, key string, value string, encrypt bool) error

type CassandraStorage

type CassandraStorage struct {
	Db *gocql.Session
}

func (CassandraStorage) BucketExists

func (c CassandraStorage) BucketExists(bucket string) bool

func (CassandraStorage) CreateBucket

func (c CassandraStorage) CreateBucket(bucket string) error

func (CassandraStorage) CreateKey

func (c CassandraStorage) CreateKey(bucket string, key string, value string, encrypt bool) error

func (CassandraStorage) DeleteBucket

func (c CassandraStorage) DeleteBucket(bucket string) error

func (CassandraStorage) DeleteKey

func (c CassandraStorage) DeleteKey(bucket string, key string) error

func (CassandraStorage) OpenDB

func (c CassandraStorage) OpenDB() (Storage, error)

Cassandra

func (CassandraStorage) ReadAllKeys

func (c CassandraStorage) ReadAllKeys(bucket string) (map[string]string, error)

func (CassandraStorage) ReadKey

func (c CassandraStorage) ReadKey(bucket string, key string, encrypted bool) (string, error)

func (CassandraStorage) UpdateKey

func (c CassandraStorage) UpdateKey(bucket string, key string, value string, encrypt bool) error

type EncryptedSecret

type EncryptedSecret struct {
	Data  []byte
	KeyId uuid.UUID
}

type PostgresStorage

type PostgresStorage struct {
	Db *gorm.DB
}

Postgres

func (PostgresStorage) BucketExists

func (p PostgresStorage) BucketExists(bucket string) bool

func (PostgresStorage) CreateBucket

func (p PostgresStorage) CreateBucket(bucket string) error

func (PostgresStorage) CreateKey

func (p PostgresStorage) CreateKey(bucket string, key string, value string, encrypt bool) error

func (PostgresStorage) DeleteBucket

func (p PostgresStorage) DeleteBucket(bucket string) error

func (PostgresStorage) DeleteKey

func (p PostgresStorage) DeleteKey(bucket string, key string) error

func (PostgresStorage) OpenDB

func (p PostgresStorage) OpenDB() (Storage, error)

func (PostgresStorage) ReadAllKeys

func (p PostgresStorage) ReadAllKeys(bucket string) (map[string]string, error)

func (PostgresStorage) ReadKey

func (p PostgresStorage) ReadKey(bucket string, key string, encrypted bool) (string, error)

func (PostgresStorage) UpdateKey

func (p PostgresStorage) UpdateKey(bucket string, key string, value string, encrypt bool) error

type Storage

type Storage interface {
	OpenDB() (Storage, error)
	CreateBucket(bucket string) error
	CreateKey(bucket string, key string, value string, encrypt bool) error
	ReadKey(bucket string, key string, encrypted bool) (string, error)
	ReadAllKeys(bucket string) (map[string]string, error)
	UpdateKey(bucket string, key string, value string, encrypt bool) error
	DeleteKey(bucket string, key string) error
	DeleteBucket(bucket string) error
	BucketExists(bucket string) bool
}
var Store Storage

func GetStore

func GetStore() Storage

Jump to

Keyboard shortcuts

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