storetest

package
v3.17.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntityAPIKey

type EntityAPIKey struct {
	EntityIdentifiers *ttnpb.EntityIdentifiers
	APIKey            *ttnpb.APIKey
}

EntityAPIKey is an API key for an entity.

type EntityCollaborator

type EntityCollaborator struct {
	EntityIdentifiers *ttnpb.EntityIdentifiers
	Collaborator      *ttnpb.Collaborator
}

EntityCollaborator is a collaborator on an entity.

type Population

type Population struct {
	Applications  []*ttnpb.Application
	Clients       []*ttnpb.Client
	EndDevices    []*ttnpb.EndDevice
	Gateways      []*ttnpb.Gateway
	Organizations []*ttnpb.Organization
	Users         []*ttnpb.User
	UserSessions  []*ttnpb.UserSession

	APIKeys     []*EntityAPIKey
	Memberships []*EntityCollaborator
}

Population is a collection of store entities.

func (*Population) NewAPIKey

func (p *Population) NewAPIKey(entityID *ttnpb.EntityIdentifiers, rights ...ttnpb.Right) *ttnpb.APIKey

NewAPIKey adds a new API key to the population and returns it. The returned API key can not be modified and will not have its CreatedAt/UpdatedAt fields populated.

func (*Population) NewApplication

func (p *Population) NewApplication(owner *ttnpb.OrganizationOrUserIdentifiers) *ttnpb.Application

NewApplication adds a new application to the population and returns it. The returned application can be modified until Population.Populate is called.

func (*Population) NewClient

NewClient adds a new client to the population and returns it. The returned client can be modified until Population.Populate is called.

func (*Population) NewEndDevice

func (p *Population) NewEndDevice(application *ttnpb.ApplicationIdentifiers) *ttnpb.EndDevice

NewEndDevice adds a new end device to the population and returns it. The returned end device can be modified until Population.Populate is called.

func (*Population) NewGateway

NewGateway adds a new gateway to the population and returns it. The returned gateway can be modified until Population.Populate is called.

func (*Population) NewMembership

func (p *Population) NewMembership(memberID *ttnpb.OrganizationOrUserIdentifiers, entityID *ttnpb.EntityIdentifiers, rights ...ttnpb.Right)

NewMembership adds a new membership to the population.

func (*Population) NewOrganization

func (p *Population) NewOrganization(owner *ttnpb.OrganizationOrUserIdentifiers) *ttnpb.Organization

NewOrganization adds a new organization to the population and returns it. The returned organization can be modified until Population.Populate is called.

func (*Population) NewUser

func (p *Population) NewUser() *ttnpb.User

NewUser adds a new user to the population and returns it. The returned user can be modified until Population.Populate is called.

func (*Population) NewUserSession

func (p *Population) NewUserSession(user *ttnpb.UserIdentifiers) *ttnpb.UserSession

NewUserSession adds a new user session to the population and returns it. The returned user session can not be modified and will not have its CreatedAt/UpdatedAt fields populated.

func (*Population) Populate

func (p *Population) Populate(ctx context.Context, st Store) error

Populate creates the population in the database. After calling Populate, the entities in the population should no longer be modified.

type Store

type Store interface {
	Init() error
	Close() error
}

type StoreTest

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

func New

func New(t *testing.T, newStore func(t *testing.T, dsn *url.URL) Store) *StoreTest

func (*StoreTest) DestroyDB

func (s *StoreTest) DestroyDB(t *testing.T, assertClean bool, exceptions ...string)

func (*StoreTest) PrepareDB

func (s *StoreTest) PrepareDB(t *testing.T) Store

func (*StoreTest) TestAPIKeyStoreCRUD

func (st *StoreTest) TestAPIKeyStoreCRUD(t *T)

func (*StoreTest) TestApplicationStoreCRUD

func (st *StoreTest) TestApplicationStoreCRUD(t *T)

func (*StoreTest) TestClientStoreCRUD

func (st *StoreTest) TestClientStoreCRUD(t *T)

func (*StoreTest) TestContactInfoStoreCRUD

func (st *StoreTest) TestContactInfoStoreCRUD(t *T)

func (*StoreTest) TestDeletedEntities

func (st *StoreTest) TestDeletedEntities(t *T)

func (*StoreTest) TestEUIStore

func (st *StoreTest) TestEUIStore(t *T)

func (*StoreTest) TestEndDeviceStoreCRUD

func (st *StoreTest) TestEndDeviceStoreCRUD(t *T)

func (*StoreTest) TestEntitySearch

func (st *StoreTest) TestEntitySearch(t *T)

func (*StoreTest) TestGatewayStoreCRUD

func (st *StoreTest) TestGatewayStoreCRUD(t *T)

func (*StoreTest) TestInvitationStore

func (st *StoreTest) TestInvitationStore(t *T)

func (*StoreTest) TestLoginTokenStore

func (st *StoreTest) TestLoginTokenStore(t *T)

func (*StoreTest) TestMembershipStoreCRUD

func (st *StoreTest) TestMembershipStoreCRUD(t *T)

func (*StoreTest) TestOAuthStore

func (st *StoreTest) TestOAuthStore(t *T)

func (*StoreTest) TestOrganizationStoreCRUD

func (st *StoreTest) TestOrganizationStoreCRUD(t *T)

func (*StoreTest) TestUserSessionStore

func (st *StoreTest) TestUserSessionStore(t *T)

func (*StoreTest) TestUserStoreCRUD

func (st *StoreTest) TestUserStoreCRUD(t *T)

Jump to

Keyboard shortcuts

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