types

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package types implements the types and validation of types necessary for the application to function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFields added in v0.18.1

func GetFields(reference interface{}) ([]string, error)

GetFields returns an unordered list of fields in a reference interface{}

func GetFieldsOrdered added in v0.18.1

func GetFieldsOrdered(reference interface{}) ([]string, error)

func ValidateFields added in v0.9.1

func ValidateFields(document bson.D, reference interface{}) (bson.D, error)

Taking a bson.D and a reference interface{}, returns a bson.D that only contains fields whose keys are also valid keys in the reference interface{}.

If an error is encountered, it is returned, and the returned bson.D will be nil.

If no error is encountered, the validated bson.D is returned, and the error will be nil.

Types

type Assemblies added in v0.18.1

type Assemblies struct {
	Assemblies []Assembly `json:"assemblies"`
}

func (*Assemblies) TabbyPrint added in v0.18.1

func (a *Assemblies) TabbyPrint() error

type AssembliesWithID added in v0.18.1

type AssembliesWithID struct {
	AssembliesWithID []AssemblyWithID `json:"assemblies"`
}

func (*AssembliesWithID) TabbyPrint added in v0.18.1

func (a *AssembliesWithID) TabbyPrint() error

type Assembly added in v0.10.1

type Assembly struct {
	Name   string   `json:"name"`
	Tags   []string `json:"tags"`
	Status string   `json:"status"`

	// An assembly's Target should point to a kit's ObjectID
	Target primitive.ObjectID `json:"target"`
}

func (*Assembly) TabbyPrint added in v0.18.1

func (a *Assembly) TabbyPrint() error

type AssemblyWithID added in v0.18.1

type AssemblyWithID struct {
	ID primitive.ObjectID `json:"_id"`
	Assembly
}

func (*AssemblyWithID) TabbyPrint added in v0.18.1

func (a *AssemblyWithID) TabbyPrint() error

type Component

type Component struct {
	Name   string   `json:"name"`
	Tags   []string `json:"tags"`
	Status string   `json:"status"`

	// A component's Target should point to a kit's or assembly's ObjectID
	Target primitive.ObjectID `json:"target"`
}

func (*Component) TabbyPrint added in v0.18.1

func (c *Component) TabbyPrint() error

type ComponentWithID added in v0.18.1

type ComponentWithID struct {
	ID primitive.ObjectID `json:"_id"`
	Component
}

func (*ComponentWithID) TabbyPrint added in v0.18.1

func (c *ComponentWithID) TabbyPrint() error

type Components added in v0.18.1

type Components struct {
	Components []Component `json:"components"`
}

func (*Components) TabbyPrint added in v0.18.1

func (c *Components) TabbyPrint() error

type ComponentsWithID added in v0.18.1

type ComponentsWithID struct {
	ComponentsWithID []ComponentWithID `json:"components"`
}

func (*ComponentsWithID) TabbyPrint added in v0.18.1

func (c *ComponentsWithID) TabbyPrint() error

type InsertResult added in v0.25.1

type InsertResult struct {
	Message     string        `json:"message"`
	InsertedIDs []interface{} `json:"inserted_ids,omitempty"`
}

func (InsertResult) TabbyPrint added in v0.25.1

func (r InsertResult) TabbyPrint() error

type Kit added in v0.10.1

type Kit struct {
	Name   string   `json:"name"`
	Tags   []string `json:"tags"`
	Status string   `json:"status"`
}

func (*Kit) TabbyPrint added in v0.18.1

func (k *Kit) TabbyPrint() error

type KitWithID added in v0.18.1

type KitWithID struct {
	ID primitive.ObjectID `json:"_id"`
	Kit
}

func (*KitWithID) TabbyPrint added in v0.18.1

func (k *KitWithID) TabbyPrint() error

type Kits added in v0.18.1

type Kits struct {
	Kits []Kit `json:"kits"`
}

func (*Kits) TabbyPrint added in v0.18.1

func (k *Kits) TabbyPrint() error

type KitsWithID added in v0.18.1

type KitsWithID struct {
	KitsWithID []KitWithID `json:"kits"`
}

func (*KitsWithID) TabbyPrint added in v0.18.1

func (k *KitsWithID) TabbyPrint() error

type TabbyPrinter added in v0.18.1

type TabbyPrinter interface {
	TabbyPrint() error
}

Jump to

Keyboard shortcuts

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