document

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 3 Imported by: 1

README

Document

Sogo github.com/xgo/database/document provides a storage abstraction layer for various storage engines with a common configuration struct and getter/setter interfaces.

Initially, it's goal is to provide services for simple key value string storage. This use case is very simple but often times you may want to use a different solution depending on your provider, e.g. DynamoDB for AWS, Redis for Heroku, and the local file system for testing.

Supported engines include:

  • DynamoDB
  • Files
  • Redis

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SetString(key, val string) error
	GetString(key string) (string, error)
	GetOrEmptyString(key string) string
	SetInterface(key string, val interface{}) error
	GetInterface(key string, val interface{}) error
}

type Config

type Config struct {
	Host               string `json:"host,omitempty"`
	Port               int    `json:"port,omitempty"`
	Password           string `json:"password,omitempty"`
	CustomIndex        int    `json:"customIndex,omitempty"` // Redis Database Index
	Region             string `json:"region,omitempty"`      // DynamoDB
	Table              string `json:"table,omitempty"`       // DynamoDB
	Directory          string `json:"directory,omitempty"`
	FileMode           uint32 `json:"fileMode,omitempty"`
	DynamodbReadUnits  int64  `json:"dynamodbReadUnits,omitempty"`
	DynamodbWriteUnits int64  `json:"dynamodbWriteUnits,omitempty"`
}

func ParseConfig

func ParseConfig(jsonBytes []byte) (*Config, error)

func (*Config) HostPort

func (cfg *Config) HostPort() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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