application

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultClock = clockwork.NewRealClock()

DefaultClock allows stubbing out the clock for a test clock.

Functions

This section is empty.

Types

type App

type App struct {
	ISA          ISAAppInterface
	Subscription SubscriptionAppInterface
}

App contains all of the per-entity Applications.

func NewFromRepo

func NewFromRepo(repo *cockroach.Store) *App

NewFromRepo is a convenience function for creating an App with the given store.

type ISAApp

type ISAApp struct {
	// TODO: don't fully embed the ISA repo once we reduce the complexity in the store.
	// Right now it's "coincidence" that the repo has the same signatures as the App interface
	// but we will want to simplify the repos and add the complexity here.
	repos.ISA
	// contains filtered or unexported fields
}

ISAApp is the main implementation of the ISAApp logic.

func (*ISAApp) Delete

Delete the given ISA

func (*ISAApp) Insert

Insert implments the ISAAppInterface Insert method

type ISAAppInterface

type ISAAppInterface interface {
	Get(ctx context.Context, id dssmodels.ID) (*ridmodels.IdentificationServiceArea, error)

	// Delete deletes the IdentificationServiceArea identified by "id" and owned by "owner".
	// Returns the delete IdentificationServiceArea and all Subscriptions affected by the delete.
	Delete(ctx context.Context, id dssmodels.ID, owner dssmodels.Owner, version *dssmodels.Version) (*ridmodels.IdentificationServiceArea, []*ridmodels.Subscription, error)

	// Insert inserts or updates an ISA.
	Insert(ctx context.Context, isa *ridmodels.IdentificationServiceArea) (*ridmodels.IdentificationServiceArea, []*ridmodels.Subscription, error)

	// Update
	Update(ctx context.Context, isa *ridmodels.IdentificationServiceArea) (*ridmodels.IdentificationServiceArea, []*ridmodels.Subscription, error)

	// SearchSubscriptions returns all subscriptions ownded by "owner" in "cells".
	Search(ctx context.Context, cells s2.CellUnion, earliest *time.Time, latest *time.Time) ([]*ridmodels.IdentificationServiceArea, error)
}

ISAAppInterface provides the interface to the application logic for ISA entities

type SubscriptionApp

type SubscriptionApp struct {
	// TODO: don't fully embed the Sub repo once we reduce the complexity in the store.
	repos.Subscription
	// contains filtered or unexported fields
}

SubscriptionApp is the main implementation of the SubscriptionApp logic.

func (*SubscriptionApp) Delete

Delete deletes the Subscription identified by "id" and owned by "owner".

func (*SubscriptionApp) Insert

Insert implements the SubscriptionAppInterface Insert method

type SubscriptionAppInterface

type SubscriptionAppInterface interface {
	Get(ctx context.Context, id dssmodels.ID) (*ridmodels.Subscription, error)

	// Delete deletes the Subscription identified by "id" and owned by "owner".
	// Returns the delete Subscription and all IdentificationServiceAreas affected by the delete.
	Delete(ctx context.Context, id dssmodels.ID, owner dssmodels.Owner, version *dssmodels.Version) (*ridmodels.Subscription, error)

	// Insert inserts or updates an Subscription.
	Insert(ctx context.Context, s *ridmodels.Subscription) (*ridmodels.Subscription, error)

	// Update
	Update(ctx context.Context, s *ridmodels.Subscription) (*ridmodels.Subscription, error)

	// SearchIdentificationServiceAreas returns all IdentificationServiceAreas ownded by "owner" in "cells".
	SearchByOwner(ctx context.Context, cells s2.CellUnion, owner dssmodels.Owner) ([]*ridmodels.Subscription, error)
}

SubscriptionAppInterface provides the interface to the application logic for Subscription entities

Jump to

Keyboard shortcuts

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