test

package
v2.26.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Data = map[string][]interface{}{
	"users": {
		User{ID: "abcdefg-123", UserName: "mikey", Email: "mikey@example.com"},
		User{ID: "hijklmn-456", UserName: "frank", Email: "frank@example.com"},
		User{ID: "ewf4ofk-555", UserName: "jacky", Email: "jacky@example.com"},
		User{ID: "rulan54-777", UserName: "jones", Email: "jones@example.com"},
	},
	"pets": {
		Pet{ID: "rebef-123", Kind: "Dog", Color: "Brown", Name: "Waldo"},
		Pet{ID: "wefwe-456", Kind: "Cat", Color: "White", Name: "Snowy"},
		Pet{ID: "goefe-789", Kind: "Hog", Color: "Green", Name: "Dicky"},
		Pet{ID: "xadaf-189", Kind: "Hog", Color: "Green", Name: "Ricky"},
	},
	"accounts": {
		Account{ID: "ba5b6e54-e29d-4b2b-8cc4-0a0b958140d2", Mail: "spooky@skeletons.org", OnPremisesSamAccountName: "MrDootDoot"},
	},
}

Data mock data.

Functions

func CreateTmpDir

func CreateTmpDir() (string, error)

CreateTmpDir creates a temporary dir for tests data.

func GetTypeFQN

func GetTypeFQN(t interface{}) string

GetTypeFQN formats a valid name from a type <t>. This is a duplication of the already existing function in the indexer package, but since there is a circular dependency we chose to duplicate it.

func ValueOf

func ValueOf(v interface{}, field string) string

ValueOf gets the value of a type v on a given field <field>.

func WriteIndexTestData

func WriteIndexTestData(m map[string][]interface{}, privateKey, dir string) (string, error)

WriteIndexTestData writes mock data to disk.

Types

type Account

type Account struct {
	ID                       string
	OnPremisesSamAccountName string
	Mail                     string
}

Account mocks an ocis account.

type Pet

type Pet struct {
	ID, Kind, Color, Name string
	UID                   int
}

Pet is a pet.

type User

type User struct {
	ID, UserName, Email string
	UID                 int
}

User is a user.

Jump to

Keyboard shortcuts

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