otherTests

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const CREATE_UNIT = "create"
View Source
const DELETE_UNIT = "delete"
View Source
const READ_UNIT = "read"
View Source
const UPDATE_UNIT = "update"

Variables

This section is empty.

Functions

func CRUDTestHandler

func CRUDTestHandler(t *testing.T, handler divan.Handler, test CRUDTestUnit) interface{}

Types

type CRUDTestUnit

type CRUDTestUnit struct {
	Name            string
	Method          string
	ID              string
	Data            interface{}
	ExpectData      interface{}
	ExpectStatus    int
	FailureExpected bool
	Set             SetData
	Config          *divanSpecs.CRUD
}

type Guy

type Guy struct {
	ID          string                 `json:"id" required:"true"`
	Age         int                    `json:"age"`
	Sex         string                 `json:"sex" restrict:"male female"`
	Description string                 `json:"description" required:"true" default:"hello\""`
	About       GuyAbout               `json:"about" ignore:"true"`
	Other       GuyOther               `json:"other"`
	Statistics  map[string]interface{} `json:"statistics" default:"{\"lastOnline\": \"yesterday\"}"`
}

func (Guy) AssignData

func (m Guy) AssignData(v interface{}) (divan.Model, error)

func (Guy) GetID

func (m Guy) GetID() string

func (Guy) Integrity

func (m Guy) Integrity() error

func (*Guy) Print

func (m *Guy) Print() string

func (Guy) UpdateIntegrity

func (m Guy) UpdateIntegrity(us *divanSpecs.Update) error

type GuyAbout

type GuyAbout struct {
	Hobbies    []string `json:"hobbies" required:"true" restrict:"do_this do_that"`
	Occupation string   `json:"occupation"`
	Name       string   `json:"name"`
	FamilyName string   `json:"family_name"`
}

func (*GuyAbout) Print

func (m *GuyAbout) Print() string

type GuyCredentials

type GuyCredentials struct {
	Username string `json:"username" required:"true"`
	Password string `json:"password" required:"true"`
}

func (*GuyCredentials) Print

func (m *GuyCredentials) Print() string

type GuyOther

type GuyOther struct {
	Credentials  GuyCredentials `json:"credentials"`
	Achievements []string       `json:"achievements"`
}

func (*GuyOther) Print

func (m *GuyOther) Print() string

type SetData

type SetData struct {
	GetDocumentFrom    interface{}
	GetUpdateSpecsFrom interface{}
	GetIDFrom          interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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