testing

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CafeAddr        = os.Getenv("CAFE_ADDR")
	CafeReferralKey = os.Getenv("CAFE_REFERRAL_KEY")
	CafeTokenSecret = os.Getenv("CAFE_TOKEN_SECRET")
)

Functions

func CreateReferral

func CreateReferral(key string, count int, limit int, requestedBy string) (*models.ReferralResponse, error)

func GetPassword

func GetPassword() string

GetPassword returns a static mneumonic to use

func GetRepoPath

func GetRepoPath() string

GetRepoPath returns the repo path to use for tests It should be considered volitile and may be destroyed at any time

func ListReferrals

func ListReferrals(key string) (*models.ReferralResponse, error)

func Pin

func Pin(reader io.Reader, token string, cType string) (int, *models.Response, error)

func Refresh

func Refresh(accessToken string, refreshToken string) (int, *models.Response, error)

func SignIn

func SignIn(creds interface{}) (int, *models.Response, error)

func SignUp

func SignUp(reg interface{}) (int, *models.Response, error)

func Verify

func Verify(_ *jwt.Token) (interface{}, error)

Types

type Repository

type Repository struct {
	Path     string
	Password string
	DB       *db.SQLiteDatastore
}

Repository represents a test (temporary/volitile) repository

func NewRepository

func NewRepository() (*Repository, error)

NewRepository creates and initializes a new temporary repository for tests

func (*Repository) ConfigFile

func (r *Repository) ConfigFile() string

ConfigFile returns the path to the test configuration file

func (*Repository) MustReset

func (r *Repository) MustReset()

MustReset sets the repo state back to a blank slate but retains keys It panics upon failure instead of allowing tests to continue

func (*Repository) RemoveRepo

func (r *Repository) RemoveRepo() error

RemoveRepo removes the test repository

func (*Repository) RemoveRoot

func (r *Repository) RemoveRoot() error

RemoveRoot removes the profile json from the repository

func (*Repository) Reset

func (r *Repository) Reset() error

Reset sets the repo state back to a blank slate but retains keys Initialize the IPFS repo if it does not already exist

Jump to

Keyboard shortcuts

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