integration

package
v0.0.0-...-f77d796 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Exactly     = Operator("Exactly")
	GreaterThan = Operator("GreaterThan")
	Anything    = Operator("Anything")
)

Helper constants for making comparisons

Variables

View Source
var (
	Actor        *models.User
	DB           *sql.DB
	Everything   *models.TopicValue
	Fetcher      *TestFetcherT
	Organization *models.Organization
	Repository   *models.Repository
	View         *models.View
)

Pre-loaded objects for common tasks

Functions

func Must

func Must(err error)

Must panics if the error is not nil

func NewTestDB

func NewTestDB() (*sql.DB, error)

Types

type Condition

type Condition struct {
	Operator Operator
	Expected int
}

func (Condition) Describe

func (c Condition) Describe(actual int) string

func (Condition) Evaluate

func (c Condition) Evaluate(actual int) bool

type CreateRepositoryOptions

type CreateRepositoryOptions struct {
	Name         string
	Organization *models.Organization
	Owner        *models.User
	System       bool
}

type CreateUserOptions

type CreateUserOptions struct {
	Name  string
	Email string
	Login string
}

type Mutator

type Mutator struct {
	Actor   *models.User
	DB      *sql.DB
	Fetcher *TestFetcherT
	View    *models.View
}

func NewMutator

func NewMutator(options MutatorOptions) *Mutator

func (Mutator) CreateRepository

func (m Mutator) CreateRepository(options CreateRepositoryOptions) *models.Repository

func (Mutator) CreateUser

func (Mutator) DeleteLinksByURL

func (m Mutator) DeleteLinksByURL(urls ...string)

func (Mutator) DeleteOrganizationsByLogin

func (m Mutator) DeleteOrganizationsByLogin(logins ...string)

func (Mutator) DeleteRepositoriesByName

func (m Mutator) DeleteRepositoriesByName(names ...string)

func (Mutator) DeleteTopicsByName

func (m Mutator) DeleteTopicsByName(names ...string)

func (Mutator) DeleteUsersByEmail

func (m Mutator) DeleteUsersByEmail(emails ...string)

func (Mutator) UpdateLinkTopics

func (m Mutator) UpdateLinkTopics(options UpdateLinkTopicsOptions)

func (Mutator) UpdateTopicParentTopics

func (m Mutator) UpdateTopicParentTopics(options UpdateTopicParentTopicsOptions)
func (m Mutator) UpsertLink(options UpsertLinkOptions) *models.LinkValue

func (Mutator) UpsertTopic

func (m Mutator) UpsertTopic(options UpsertTopicOptions) *models.TopicValue

type MutatorOptions

type MutatorOptions struct{}

type Operator

type Operator string

type TestFetcherT

type TestFetcherT struct{}

func (*TestFetcherT) FetchPage

func (f *TestFetcherT) FetchPage(url string) (*pageinfo.PageInfo, error)

type UpdateLinkTopicsOptions

type UpdateLinkTopicsOptions struct {
	Link           *models.LinkValue
	ParentTopicIds []string
}

type UpdateTopicParentTopicsOptions

type UpdateTopicParentTopicsOptions struct {
	Topic          *models.TopicValue
	ParentTopicIds []string
}

type UpsertLinkOptions

type UpsertLinkOptions struct {
	ParentTopicIds []string
	Repository     *models.Repository
	Title          string
	URL            string
}

type UpsertTopicOptions

type UpsertTopicOptions struct {
	Name           string
	ParentTopicIds []string
	Repository     *models.Repository
}

Jump to

Keyboard shortcuts

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