dsunit

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

README

Datastore services

Datastore service uses dsunit service to create, populate, and verify content of datastore.

Service Id Action Description Request Response
dsunit register register database connection RegisterRequest RegisterResponse
dsunit recreate recreate database/datastore RecreateRequest RecreateResponse
dsunit sql run SQL commands RunSQLRequest RunSQLResponse
dsunit script run SQL script RunScriptRequest RunSQLResponse
dsunit mapping register database table mapping (view), MappingRequest MappingResponse
dsunit init initialize datastore (register, recreate, run sql, add mapping) InitRequest MappingResponse
dsunit prepare populate databstore with provided data PrepareRequest MappingResponse
dsunit expect verify databstore with provided data ExpectRequest MappingResponse
dsunit query run SQL query QueryRequest QueryResponse
dsunit sequence get sequence values for supplied tables SequenceRequest SequenceResponse

Documentation

Index

Constants

View Source
const (
	//ServiceID represents a data store unit service id
	ServiceID = "dsunit"
)

Variables

This section is empty.

Functions

func AsTableRecords

func AsTableRecords(dataKey interface{}, state data.Map) (interface{}, error)

AsTableRecords converts data spcified by dataKey into slice of *TableData to create dsunit data as map[string][]map[string]interface{} (table with records)

func New

func New() endly.Service

New creates a new Datastore unit service

Types

type ExpectRequest

type ExpectRequest dsunit.ExpectRequest

ExpectRequest represents an expect request

type ExpectResponse

type ExpectResponse dsunit.ExpectResponse

ExpectResponse represent an expect response

func (*ExpectResponse) Assertion

func (r *ExpectResponse) Assertion() []*assertly.Validation

Assertion returns description with validation slice

type InitRequest

type InitRequest dsunit.InitRequest

InitRequest represents an init request

func (*InitRequest) Messages

func (r *InitRequest) Messages() []*msg.Message

Messages returns messages

type InitResponse

type InitResponse dsunit.InitResponse

InitResponse represents an init response

type MappingRequest

type MappingRequest dsunit.MappingRequest

MappingRequest represents a mapping request

func (*MappingRequest) Messages

func (r *MappingRequest) Messages() []*msg.Message

Messages returns messages

type MappingResponse

type MappingResponse dsunit.MappingResponse

MappingResponse represents a mapping response

type PopulateDatastoreEvent

type PopulateDatastoreEvent struct {
	Datastore string `required:"true" description:"register datastore name"` //target host
	Table     string
	Rows      int
}

PopulateDatastoreEvent represents a populate Datastore event

type PrepareRequest

type PrepareRequest dsunit.PrepareRequest

PrepareRequest represents a prepare request

func (*PrepareRequest) Messages

func (r *PrepareRequest) Messages() []*msg.Message

Messages returns messages

type PrepareResponse

type PrepareResponse dsunit.PrepareResponse

PrepareResponse represents a prepare response

type QueryRequest

type QueryRequest dsunit.QueryRequest

QueryRequest represents an query request

type QueryResponse

type QueryResponse dsunit.QueryResponse

QueryResponse represents dsunit response

type RecreateRequest

type RecreateRequest dsunit.RecreateRequest

RecreateRequest represents a recreate request

type RecreateResponse

type RecreateResponse dsunit.RecreateResponse

RecreateResponse represent a recreate response

type RegisterRequest

type RegisterRequest dsunit.RegisterRequest

RegisterRequest represents a register request

func (*RegisterRequest) Messages

func (r *RegisterRequest) Messages() []*msg.Message

Messages returns messages

type RegisterResponse

type RegisterResponse dsunit.RegisterResponse

RegisterResponse represents a register response

type RunSQLRequest

type RunSQLRequest dsunit.RunSQLRequest

RunSQLRequest represent run SQL request

type RunSQLResponse

type RunSQLResponse dsunit.RunSQLResponse

RunSQLResponse represents a script response

type RunSQLcriptEvent

type RunSQLcriptEvent struct {
	Datastore string
	URL       string
}

RunSQLcriptEvent represents run script event

type RunScriptRequest

type RunScriptRequest dsunit.RunScriptRequest

RunScriptRequest represents a script request

func (*RunScriptRequest) Messages

func (r *RunScriptRequest) Messages() []*msg.Message

Messages returns messages

type SequenceRequest

type SequenceRequest dsunit.SequenceRequest

type SequenceRequest represents a sequence request

type SequenceResponse

type SequenceResponse dsunit.SequenceResponse

SequenceResponse represent a sequence response

func (*SequenceResponse) Messages

func (r *SequenceResponse) Messages() []*msg.Message

Messages returns messages

type TableData

type TableData struct {
	Table         string
	Value         interface{}
	AutoGenerate  map[string]string `json:",omitempty"`
	PostIncrement []string          `json:",omitempty"`
	Key           string
}

TableData represents table data

func (*TableData) AutoGenerateIfNeeded

func (d *TableData) AutoGenerateIfNeeded(state data.Map) error

AutoGenerateIfNeeded retrieves auto generated values

func (*TableData) GetValue

func (d *TableData) GetValue(state data.Map, source interface{}) map[string]interface{}

GetValue returns record.

func (*TableData) GetValues

func (d *TableData) GetValues(state data.Map) []map[string]interface{}

GetValues a table records.

func (*TableData) PostIncrementIfNeeded

func (d *TableData) PostIncrementIfNeeded(state data.Map)

PostIncrementIfNeeded increments all specified counters by one.

Jump to

Keyboard shortcuts

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