repo

package
v0.0.0-...-f24e7f3 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

func Int64

func Int64(i int64) *int64

func String

func String(s string) *string

Types

type Attachment

type Attachment struct {
	Entity          `bson:",inline"`
	VersionedEntity `bson:",inline"`
	SuiteId         *Id     `json:"suiteId,omitempty" bson:"suite_id"`
	CaseId          *Id     `json:"caseId,omitempty" bson:"case_id"`
	Filename        *string `json:"filename,omitempty"`
	ContentType     *string `json:"contentType,omitempty" bson:"content_type"`
	Size            *int64  `json:"size,omitempty"`
	Timestamp       *MsTime `json:"timestamp,omitempty"`
}

type Case

type Case struct {
	Entity          `bson:",inline"`
	VersionedEntity `bson:",inline"`
	SuiteId         *Id         `json:"suiteId,omitempty" bson:"suite_id"`
	Name            *string     `json:"name,omitempty" bson:",omitempty"`
	Description     *string     `json:"description,omitempty" bson:",omitempty"`
	Tags            []string    `json:"tags,omitempty" bson:",omitempty"`
	Idx             *int64      `json:"idx,omitempty"`
	Status          *CaseStatus `json:"status,omitempty"`
	Result          *CaseResult `json:"result,omitempty" bson:",omitempty"`
	CreatedAt       *MsTime     `json:"createdAt,omitempty" bson:"created_at"`
	StartedAt       *MsTime     `json:"startedAt,omitempty" bson:"started_at,omitempty"`
	FinishedAt      *MsTime     `json:"finishedAt,omitempty" bson:"finished_at,omitempty"`
}

type CaseResult

type CaseResult string
const (
	CaseResultPassed  CaseResult = "passed"
	CaseResultFailed  CaseResult = "failed"
	CaseResultSkipped CaseResult = "skipped"
	CaseResultAborted CaseResult = "aborted"
	CaseResultErrored CaseResult = "errored"
)

type CaseStatus

type CaseStatus string
const (
	CaseStatusCreated  CaseStatus = "created"
	CaseStatusStarted  CaseStatus = "started"
	CaseStatusFinished CaseStatus = "finished"
)

type Change

type Change struct {
	Coll Coll
	Msg  json.RawMessage
}

type Coll

type Coll string
const (
	Attachments Coll = "attachments"
	Cases       Coll = "cases"
	Logs        Coll = "logs"
	Suites      Coll = "suites"
)

type ContextCloser

type ContextCloser interface {
	Close(ctx context.Context) error
}

type Entity

type Entity struct {
	Id *Id `json:"id,omitempty" bson:"_id,omitempty"`
}

type Id

func NewId

func NewId(hex string) (Id, error)

func (Id) MarshalBSONValue

func (i Id) MarshalBSONValue() (bsontype.Type, []byte, error)

func (Id) MarshalJSON

func (i Id) MarshalJSON() ([]byte, error)

func (Id) String

func (i Id) String() string

func (*Id) UnmarshalBSONValue

func (i *Id) UnmarshalBSONValue(bt bsontype.Type, b []byte) error

func (*Id) UnmarshalJSON

func (i *Id) UnmarshalJSON(b []byte) error

type LogLine

type LogLine struct {
	Entity `bson:",inline"`
	CaseId *Id     `json:"caseId,omitempty" bson:"case_id"`
	Idx    *int64  `json:"idx,omitempty"`
	Error  *bool   `json:"error,omitempty" bson:",omitempty"`
	Line   *string `json:"line,omitempty" bson:",omitempty"`
}

type MsTime

type MsTime time.Time

func NewMsTime

func NewMsTime(ms int64) MsTime

func (MsTime) MarshalBSONValue

func (t MsTime) MarshalBSONValue() (bsontype.Type, []byte, error)

func (MsTime) MarshalJSON

func (t MsTime) MarshalJSON() ([]byte, error)

func (MsTime) String

func (t MsTime) String() string

func (*MsTime) UnmarshalBSONValue

func (t *MsTime) UnmarshalBSONValue(bt bsontype.Type, b []byte) error

func (*MsTime) UnmarshalJSON

func (t *MsTime) UnmarshalJSON(b []byte) error

type Repo

type Repo struct {
	// contains filtered or unexported fields
}

func Open

func Open(addr, replSet, user, pass, db string) (*Repo, error)

func (*Repo) AllAttachments

func (r *Repo) AllAttachments(ctx context.Context) ([]Attachment, error)

func (*Repo) Attachment

func (r *Repo) Attachment(ctx context.Context, id Id) (Attachment, error)

func (*Repo) Case

func (r *Repo) Case(ctx context.Context, id Id) (Case, error)

func (*Repo) CaseAttachments

func (r *Repo) CaseAttachments(ctx context.Context,
	caseId Id) ([]Attachment, error)

func (*Repo) CaseLogLines

func (r *Repo) CaseLogLines(ctx context.Context,
	caseId Id) ([]LogLine, error)

func (*Repo) Close

func (r *Repo) Close() error

func (*Repo) DisconnectSuite

func (r *Repo) DisconnectSuite(ctx context.Context, id Id, at MsTime) error

func (*Repo) FinishCase

func (r *Repo) FinishCase(ctx context.Context, id Id, res CaseResult,
	at MsTime) error

func (*Repo) FinishSuite

func (r *Repo) FinishSuite(ctx context.Context, id Id, res SuiteResult,
	at MsTime) error

func (*Repo) InsertAttachment

func (r *Repo) InsertAttachment(ctx context.Context, a Attachment) (Id, error)

func (*Repo) InsertCase

func (r *Repo) InsertCase(ctx context.Context, c Case) (Id, error)

func (*Repo) InsertLogLine

func (r *Repo) InsertLogLine(ctx context.Context, ll LogLine) (Id, error)

func (*Repo) InsertSuite

func (r *Repo) InsertSuite(ctx context.Context, s Suite) (Id, error)

func (*Repo) LogLine

func (r *Repo) LogLine(ctx context.Context, id Id) (LogLine, error)

func (*Repo) Seed

func (r *Repo) Seed() error

func (*Repo) Suite

func (r *Repo) Suite(ctx context.Context, id Id) (Suite, error)

func (*Repo) SuiteAttachments

func (r *Repo) SuiteAttachments(ctx context.Context,
	suiteId Id) ([]Attachment, error)

func (*Repo) SuiteCases

func (r *Repo) SuiteCases(ctx context.Context,
	suiteId Id) ([]Case, error)

func (*Repo) SuitePage

func (r *Repo) SuitePage(ctx context.Context) (SuitePage, error)

func (*Repo) SuitePageAfter

func (r *Repo) SuitePageAfter(ctx context.Context,
	cursor SuitePageCursor) (SuitePage, error)

func (*Repo) Watch

func (r *Repo) Watch(ctx context.Context) (<-chan Change, <-chan error)

type Suite

type Suite struct {
	Entity          `bson:",inline"`
	VersionedEntity `bson:",inline"`
	Project         *string      `json:"project,omitempty" bson:",omitempty"`
	Tags            []string     `json:"tags,omitempty" bson:",omitempty"`
	PlannedCases    *int64       `json:"plannedCases,omitempty" bson:"planned_cases,omitempty"`
	Status          *SuiteStatus `json:"status,omitempty"`
	Result          *SuiteResult `json:"result,omitempty" bson:",omitempty"`
	DisconnectedAt  *MsTime      `json:"disconnectedAt,omitempty" bson:"disconnected_at,omitempty"`
	StartedAt       *MsTime      `json:"startedAt,omitempty" bson:"started_at"`
	FinishedAt      *MsTime      `json:"finishedAt,omitempty" bson:"finished_at,omitempty"`
}

type SuitePage

type SuitePage struct {
	Next   *SuitePageCursor `json:"next,omitempty"`
	Suites []Suite          `json:"suites"`
}

type SuitePageCursor

type SuitePageCursor struct {
	Id        Id
	StartedAt MsTime
}

func NewSuitePageCursor

func NewSuitePageCursor(s string) (c SuitePageCursor, err error)

func (SuitePageCursor) MarshalBSONValue

func (c SuitePageCursor) MarshalBSONValue() (bsontype.Type, []byte, error)

func (SuitePageCursor) MarshalJSON

func (c SuitePageCursor) MarshalJSON() ([]byte, error)

func (SuitePageCursor) String

func (c SuitePageCursor) String() string

func (*SuitePageCursor) UnmarshalBSONValue

func (c *SuitePageCursor) UnmarshalBSONValue(_ bsontype.Type, b []byte) error

func (*SuitePageCursor) UnmarshalJSON

func (c *SuitePageCursor) UnmarshalJSON(b []byte) error

type SuiteResult

type SuiteResult string
const (
	SuiteResultPassed SuiteResult = "passed"
	SuiteResultFailed SuiteResult = "failed"
)

func (*SuiteResult) UnmarshalJSON

func (r *SuiteResult) UnmarshalJSON(b []byte) error

type SuiteStatus

type SuiteStatus string
const (
	SuiteStatusStarted      SuiteStatus = "started"
	SuiteStatusFinished     SuiteStatus = "finished"
	SuiteStatusDisconnected SuiteStatus = "disconnected"
)

type VersionedEntity

type VersionedEntity struct {
	Version *int64 `json:"version,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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