filefixture

package
v0.52.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowName

func ShowName(input io.Reader)

ShowName displays the name, id and hash of a filefixture

Types

type FileFixture

type FileFixture struct {
	ID             string     `jsonapi:"primary,file_fixture_structureds"`
	Name           string     `jsonapi:"attr,name"`
	CurrentVersion *Version   `jsonapi:"relation,current_version,omitempty"`
	Versions       []*Version `jsonapi:"relation,versions,omitempty"`
	CreatedAt      time.Time  `jsonapi:"attr,created_at,iso8601"`
	UpdatedAt      time.Time  `jsonapi:"attr,updated_at,iso8601"`
}

FileFixture represents a single file fixture

func UnmarshalFileFixture

func UnmarshalFileFixture(input io.Reader) (*FileFixture, error)

UnmarshalFileFixture unmarshals a single FileFixture record

type List

type List struct {
	Fixtures []*FileFixture
}

List is a list of FileFixtures, used for index action

func Unmarshal added in v0.22.0

func Unmarshal(input io.Reader) (List, error)

Unmarshal unmarshals a list of FileFixture records

func (List) FindByName

func (fileFixtures List) FindByName(name string) FileFixture

FindByName look up a FileFixture by name in List

type Version

type Version struct {
	ID         string    `jsonapi:"primary,file_fixture_version_structureds"`
	Hash       string    `jsonapi:"attr,hash"`
	FileSize   int       `jsonapi:"attr,file_size"`
	ItemCount  int       `jsonapi:"attr,item_count"`
	FieldNames []string  `jsonapi:"attr,field_names"`
	CreatedAt  time.Time `jsonapi:"attr,created_at,iso8601"`
	UpdatedAt  time.Time `jsonapi:"attr,updated_at,iso8601"`
}

Version respresents a concrete version of a file fixture

Jump to

Keyboard shortcuts

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