testutils

package
v0.0.0-...-cda998f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTestDocument

func BuildTestDocument() *did.Document

BuildTestDocument builds a test DID document

func DeleteCreatedEntities

func DeleteCreatedEntities(db *gorm.DB) func()

DeleteCreatedEntities sets up a hook to clean up the db after the test

func GetTestDBConnection

func GetTestDBConnection() (*gorm.DB, error)

GetTestDBConnection returns a new gorm Database connection for the local docker instance

Types

type DBCreds

type DBCreds struct {
	Port     int
	Dbname   string
	User     string
	Password string
	Host     string
}

DBCreds is a struct to contain the creds for the test db

func GetTestDBCreds

func GetTestDBCreds() DBCreds

GetTestDBCreds returns the credentials for the local docker instance dependent on env vars.

type FakePubSubService

type FakePubSubService struct{}

FakePubSubService stubs out a pub sub service

func (*FakePubSubService) PublishAdd

func (*FakePubSubService) PublishAdd(token *jwt.Token) error

PublishAdd does nothing

func (*FakePubSubService) PublishRevoke

func (*FakePubSubService) PublishRevoke(token *jwt.Token) error

PublishRevoke does nothing

Jump to

Keyboard shortcuts

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