id

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: GPL-3.0 Imports: 6 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorExistenceChecker

type ActorExistenceChecker interface {
	// Exists checks, if the given actor is already existent in storage.
	Exists(id ActorID) (bool, error)
}

ActorExistenceChecker provides everything needed to check, if an actor is already existent in storage.

type ActorID

type ActorID string

ActorID hold all needed data to identify the an actor in the whole system. For an actor this is only his name Actors can be users or groups

func NewActorID

func NewActorID(actor string) ActorID

NewActorID returns a new ActorID containing the given name. No validation will be performed.

func (ActorID) Actor

func (id ActorID) Actor() string

Actor returns the name of the actor

func (ActorID) Validate

func (id ActorID) Validate(oec ActorExistenceChecker) error

Validate checks if this is a valid id for a new actor.

type ProjectExistenceChecker

type ProjectExistenceChecker interface {
	//Exists checks, if the given project is already existent in storage.
	Exists(id ProjectID) (bool, error)
}

ProjectExistenceChecker provides everything needed to check, if a project is already existent in storage.

type ProjectID

type ProjectID struct {
	ActorID
	// contains filtered or unexported fields
}

ProjectID hold all needed data to identify the a project in the whole system. This is the name and the owner of the project

func NewProjectID

func NewProjectID(owner ActorID, project string) ProjectID

NewProjectID returns a new ProjectID containing the given name and owner. No validation will be performed.

func (ProjectID) Owner

func (id ProjectID) Owner() string

Owner returns the name of the owner

func (ProjectID) Project

func (id ProjectID) Project() string

Project returns the name of the (superior) project

func (ProjectID) Validate

func (id ProjectID) Validate(pec ProjectExistenceChecker) error

Validate checks if this is a valid id for a new project.

type ProtocolExistenceChecker

type ProtocolExistenceChecker interface {
	//Exists checks, if the given protocol is already existent in storage.
	Exists(id ProtocolID) (bool, error)
}

ProtocolExistenceChecker provides everything needed to check, if a protocol is already existent in storage.

type ProtocolID

type ProtocolID struct {
	TestVersionID
	Protocol int
}

ProtocolID hold all needed data to identify the a protocol in the whole system. This is the number of the protocol and the test version that was executed. Protocol can be related to a case verison or a sequence version

func NewProtocolID

func NewProtocolID(testVersion TestVersionID, protocol int) ProtocolID

NewProtocolID returns a new ProtocolID containing the given protocol number and related test version. No validation will be performed.

func (*ProtocolID) GobDecode added in v1.0.0

func (id *ProtocolID) GobDecode(data []byte) (err error)

GobDecode decodes the id from a byte stream. All fields of the id called on will be overwritten

func (*ProtocolID) GobEncode added in v1.0.0

func (id *ProtocolID) GobEncode() ([]byte, error)

GobEncode encodes the id to a byte stream so it can be stored for example to a session

func (ProtocolID) MarshalJSON added in v1.5.0

func (id ProtocolID) MarshalJSON() ([]byte, error)

MarshalJSON will marshal the id into json

func (*ProtocolID) UnmarshalJSON added in v1.5.0

func (id *ProtocolID) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON will unmarshal the id from a given json. All fields of the id called on will be overwritten

func (ProtocolID) Validate

func (id ProtocolID) Validate(pec ProtocolExistenceChecker) error

Validate checks if this is a valid id for a new protocol.

type TestExistenceChecker

type TestExistenceChecker interface {
	//Exists checks, if the given test is already existent in storage.
	Exists(id TestID) (bool, error)
}

TestExistenceChecker provides everything needed to check, if a test is already existent in storage.

type TestID

type TestID struct {
	ProjectID
	// contains filtered or unexported fields
}

TestID hold all needed data to identify the a test in the whole system. This is the name, the superior project and a flag to differ between case and sequence Tests can be cases or sequences

func NewTestID

func NewTestID(project ProjectID, test string, testCase bool) TestID

NewTestID returns a new TestID containing the given name and superior project. No validation will be performed.

func (TestID) IsCase

func (id TestID) IsCase() bool

IsCase returns true if the test is a case and false if the test is a sequence

func (TestID) Test

func (id TestID) Test() string

Test returns the name of the (superior) test

func (TestID) Validate

func (id TestID) Validate(tec TestExistenceChecker) error

Validate checks if this is a valid id for a new test.

type TestVersionExistenceChecker

type TestVersionExistenceChecker interface {
	//Exists checks, if the given testVersion is already existent in storage.
	Exists(id TestVersionID) (bool, error)
}

TestVersionExistenceChecker provides everything needed to check, if a testVersion is already existent in storage.

type TestVersionID

type TestVersionID struct {
	TestID
	// contains filtered or unexported fields
}

TestVersionID hold all needed data to identify the a test version in the whole system. This is the number of the version and the superior test Test versions can be versions of cases or sequences

func NewTestVersionID

func NewTestVersionID(test TestID, testVersion int) TestVersionID

NewTestVersionID returns a new TestVersionID containing the given version number and superior test. No validation will be performed.

func (*TestVersionID) GobDecode

func (id *TestVersionID) GobDecode(data []byte) (err error)

GobDecode decodes the id from a byte stream. All fields of the id called on will be overwritten

func (*TestVersionID) GobEncode

func (id *TestVersionID) GobEncode() ([]byte, error)

GobEncode encodes the id to a byte stream so it can be stored for example to a session

func (TestVersionID) MarshalJSON

func (id TestVersionID) MarshalJSON() ([]byte, error)

MarshalJSON will marshal the id into json

func (TestVersionID) TestVersion

func (id TestVersionID) TestVersion() int

TestVersion returns the version number of the test version

func (*TestVersionID) UnmarshalJSON

func (id *TestVersionID) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON will unmarshal the id from a given json. All fields of the id called on will be overwritten

func (TestVersionID) Validate

Validate checks if this is a valid id for a new test version.

Jump to

Keyboard shortcuts

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