mock

package
v0.0.0-...-9090b94 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	Memory map[string]*ale.JenkinsData
}

DB holds a mocked in-memory database

func (*DB) Get

func (db *DB) Get(buildID string) (*ale.JenkinsData, error)

Get retrieves data from the database

func (*DB) Has

func (db *DB) Has(buildID string) (bool, error)

Has checks the existance in the database

func (*DB) Put

func (db *DB) Put(data *ale.JenkinsData, buildID string) error

Put inserts data into the database

func (*DB) Remove

func (db *DB) Remove(buildID string) error

Remove deletes an entry from the database

type Datastore

type Datastore struct {
	PutFn        func(context.Context, *datastore.Key, interface{}) (*datastore.Key, error)
	PutFnInvoked bool

	GetFn        func(context.Context, *datastore.Key, interface{}) error
	GetFnInvoked bool

	CountFn        func(context.Context, *datastore.Query) (int, error)
	CountFnInvoked bool

	DeleteFn        func(context.Context, *datastore.Key) error
	DeleteFnInvoked bool
	// contains filtered or unexported fields
}

Datastore is a mock of the Google Cloud Datastore

func (*Datastore) Count

func (md *Datastore) Count(ctx context.Context, query *datastore.Query) (int, error)

func (*Datastore) Delete

func (md *Datastore) Delete(ctx context.Context, key *datastore.Key) error

func (*Datastore) Get

func (md *Datastore) Get(ctx context.Context, key *datastore.Key, data interface{}) error

func (*Datastore) Put

func (md *Datastore) Put(ctx context.Context, key *datastore.Key, data interface{}) (*datastore.Key, error)

Jump to

Keyboard shortcuts

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