Documentation ¶
Index ¶
- Constants
- func ExecuteRequest(req *http.Request, router http.Handler) *httptest.ResponseRecorder
- type AddedDataRecords
- type AddedMetaRecords
- type FakeProjectStations
- type FilePair
- type InMemoryArchive
- func (a *InMemoryArchive) Archive(ctx context.Context, contentType string, meta map[string]string, ...) (*files.ArchivedFile, error)
- func (a *InMemoryArchive) DeleteByURL(ctx context.Context, url string) error
- func (a *InMemoryArchive) Info(ctx context.Context, key string) (info *files.FileInfo, err error)
- func (a *InMemoryArchive) OpenByURL(ctx context.Context, url string) (of *files.OpenedFile, err error)
- func (a *InMemoryArchive) Opened(ctx context.Context, url string, opened *files.OpenedFile) (*files.OpenedFile, error)
- func (a *InMemoryArchive) String() string
- type MetaAndData
- type SignedRecordAndData
- type TestConfig
- type TestEnv
- func (e *TestEnv) AddAdminUser() (*data.User, error)
- func (e *TestEnv) AddIngestion(user *data.User, url, typeName string, deviceID []byte, length int) (*data.QueuedIngestion, *data.Ingestion, error)
- func (e *TestEnv) AddInvalidUser() (*data.User, error)
- func (e *TestEnv) AddMetaAndData(station *data.Station, user *data.User, numberData int) (*MetaAndData, error)
- func (e *TestEnv) AddProject() (*data.Project, error)
- func (e *TestEnv) AddProjectActivity(project *data.Project, station *data.Station, user *data.User) error
- func (e *TestEnv) AddProjectUser(p *data.Project, u *data.User, r *data.Role) error
- func (e *TestEnv) AddProjectWithPrivacy(privacy data.PrivacyType) (*data.Project, error)
- func (e *TestEnv) AddProvision(deviceID, generationID []byte) (*data.Provision, error)
- func (e *TestEnv) AddRandomSensors() error
- func (e *TestEnv) AddStationActivity(station *data.Station, user *data.User) error
- func (e *TestEnv) AddStations(number int) (*FakeProjectStations, error)
- func (e *TestEnv) AddStationsOwnedBy(owner *data.User, number int) ([]*data.Station, error)
- func (e *TestEnv) AddStationsToProject(project *data.Project, owner *data.User, number int) (*FakeProjectStations, error)
- func (e *TestEnv) AddUser() (*data.User, error)
- func (e *TestEnv) MustDeviceID() []byte
- func (e *TestEnv) NewAuthorizationHeader() string
- func (e *TestEnv) NewAuthorizationHeaderForAdmin() string
- func (e *TestEnv) NewAuthorizationHeaderForUser(user *data.User) string
- func (e *TestEnv) NewDataReading(meta, reading uint64) *pb.DataRecord
- func (e *TestEnv) NewFilePair(nmeta, ndata int) (*FilePair, error)
- func (e *TestEnv) NewHttpStatusReply(s *data.Station) *pbapp.HttpReply
- func (e *TestEnv) NewLiveReadingsReply(s *data.Station) *pbapp.HttpReply
- func (e *TestEnv) NewMetaLayout(record uint64) *SignedRecordAndData
- func (e *TestEnv) NewRandomData(n int) ([]byte, error)
- func (e *TestEnv) NewStation(owner *data.User) *data.Station
- func (e *TestEnv) NewTokenForUser(user *data.User) string
Constants ¶
View Source
const ( GoodPassword = "goodgoodgood" BadPassword = "badbadbadbad" )
Variables ¶
This section is empty.
Functions ¶
func ExecuteRequest ¶
Types ¶
type AddedDataRecords ¶
type AddedMetaRecords ¶
type FakeProjectStations ¶
type InMemoryArchive ¶
type InMemoryArchive struct {
// contains filtered or unexported fields
}
func NewInMemoryArchive ¶
func NewInMemoryArchive(files map[string][]byte) (a *InMemoryArchive)
func (*InMemoryArchive) DeleteByURL ¶
func (a *InMemoryArchive) DeleteByURL(ctx context.Context, url string) error
func (*InMemoryArchive) OpenByURL ¶
func (a *InMemoryArchive) OpenByURL(ctx context.Context, url string) (of *files.OpenedFile, err error)
func (*InMemoryArchive) Opened ¶
func (a *InMemoryArchive) Opened(ctx context.Context, url string, opened *files.OpenedFile) (*files.OpenedFile, error)
func (*InMemoryArchive) String ¶
func (a *InMemoryArchive) String() string
type MetaAndData ¶
type MetaAndData struct { Meta *AddedMetaRecords Data *AddedDataRecords }
type SignedRecordAndData ¶
type SignedRecordAndData struct { Signed *pb.SignedRecord Data *pb.DataRecord Bytes []byte }
type TestConfig ¶
type TestConfig struct {
PostgresURL string `split_words:"true" default:"postgres://fieldkit:password@127.0.0.1:5432/fieldkit?sslmode=disable" required:"true"`
}
type TestEnv ¶
type TestEnv struct { Ctx context.Context DB *sqlxcache.DB DbPool *pgxpool.Pool PostgresURL string SessionKey string JWTHMACKey []byte Seed int64 }
func NewTestEnv ¶
func (*TestEnv) AddIngestion ¶
func (*TestEnv) AddMetaAndData ¶
func (*TestEnv) AddProjectActivity ¶
func (*TestEnv) AddProjectUser ¶
func (*TestEnv) AddProjectWithPrivacy ¶
func (*TestEnv) AddProvision ¶
func (*TestEnv) AddRandomSensors ¶
func (*TestEnv) AddStationActivity ¶
func (*TestEnv) AddStations ¶
func (e *TestEnv) AddStations(number int) (*FakeProjectStations, error)
func (*TestEnv) AddStationsOwnedBy ¶
func (*TestEnv) AddStationsToProject ¶
func (*TestEnv) MustDeviceID ¶
func (*TestEnv) NewAuthorizationHeader ¶
func (*TestEnv) NewAuthorizationHeaderForAdmin ¶
func (*TestEnv) NewAuthorizationHeaderForUser ¶
func (*TestEnv) NewDataReading ¶
func (e *TestEnv) NewDataReading(meta, reading uint64) *pb.DataRecord
func (*TestEnv) NewHttpStatusReply ¶
func (*TestEnv) NewLiveReadingsReply ¶
func (*TestEnv) NewMetaLayout ¶
func (e *TestEnv) NewMetaLayout(record uint64) *SignedRecordAndData
Click to show internal directories.
Click to hide internal directories.