api

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewV1Handler

func NewV1Handler(r Repo) http.Handler

func Serve

func Serve(ctx context.Context, opts Options) error

Types

type FileMeta

type FileMeta interface {
	Name() string
	ContentType() string
}

type FileMetaRepo

type FileMetaRepo interface {
	FileMeta(id string) (FileMeta, error)
}

type Options

type Options struct {
	Addr        string
	TlsCertFile string
	TlsKeyFile  string
	PublicDir   string

	UserContentHost string
	UserContentDir  string
	UserContentRepo FileMetaRepo

	V1 http.Handler
}

type Repo

type Repo interface {
	InsertAttachment(ctx context.Context, a repo.Attachment) (id repo.Id, err error)
	Attachment(ctx context.Context, id repo.Id) (repo.Attachment, error)
	AllAttachments(ctx context.Context) ([]repo.Attachment, error)
	SuiteAttachments(ctx context.Context, suiteId repo.Id) ([]repo.Attachment, error)
	CaseAttachments(ctx context.Context, caseId repo.Id) ([]repo.Attachment, error)

	InsertSuite(ctx context.Context, s repo.Suite) (id repo.Id, err error)
	Suite(ctx context.Context, id repo.Id) (repo.Suite, error)
	SuitePage(ctx context.Context) (repo.SuitePage, error)
	SuitePageAfter(ctx context.Context, cursor repo.SuitePageCursor) (repo.SuitePage, error)
	FinishSuite(ctx context.Context, id repo.Id, result repo.SuiteResult, at repo.MsTime) error
	DisconnectSuite(ctx context.Context, id repo.Id, at repo.MsTime) error

	InsertCase(ctx context.Context, c repo.Case) (id repo.Id, err error)
	Case(ctx context.Context, id repo.Id) (repo.Case, error)
	SuiteCases(ctx context.Context, suiteId repo.Id) ([]repo.Case, error)
	FinishCase(ctx context.Context, id repo.Id, result repo.CaseResult, at repo.MsTime) error

	InsertLogLine(ctx context.Context, ll repo.LogLine) (id repo.Id, err error)
	LogLine(ctx context.Context, id repo.Id) (repo.LogLine, error)
	CaseLogLines(ctx context.Context, llId repo.Id) ([]repo.LogLine, error)

	Watch(ctx context.Context) (<-chan repo.Change, <-chan error)
}

Jump to

Keyboard shortcuts

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