common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatKV

func FormatKV(key, value string) string

FormatKV formats key and value to env variable as key=value

func ProjectName

func ProjectName() (string, error)

ProjectName gets project name

Types

type BoltStore

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

BoltStore implements store

func (*BoltStore) Close

func (bs *BoltStore) Close() error

Close closes store database

func (*BoltStore) Get

func (bs *BoltStore) Get(key string) ([2]string, error)

Get retrieves value for a key

func (*BoltStore) GetMany

func (bs *BoltStore) GetMany() ([][2]string, error)

GetMany fetches all key value pairs for project

func (*BoltStore) Set

func (bs *BoltStore) Set(env [2]string) error

Set creates env in db

func (*BoltStore) SetMany

func (bs *BoltStore) SetMany(envs [][2]string) error

SetMany adds multiple envs to db

type Store

type Store interface {
	io.Closer
	Get(key string) ([2]string, error)
	GetMany() ([][2]string, error)
	Set(env [2]string) error
	SetMany(envs [][2]string) error
}

Store describes how kv handles database

func NewStore

func NewStore() Store

NewStore creates new data store

Jump to

Keyboard shortcuts

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