test_internals

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertIsTestImage

func AssertIsTestImage(t *testing.T, i io.Reader)

func MakeTestImage

func MakeTestImage(width int, height int) (string, io.Reader, error)

Types

type ContainerDeps

type ContainerDeps struct {
	Homeservers []*SynapseDep
	Machines    []*mmrContainer
	// contains filtered or unexported fields
}

func MakeTestDeps

func MakeTestDeps() (*ContainerDeps, error)

func (*ContainerDeps) Debug

func (c *ContainerDeps) Debug()

func (*ContainerDeps) Teardown

func (c *ContainerDeps) Teardown()

type EnvCustomizer

type EnvCustomizer struct {
	testcontainers.ContainerCustomizer
	// contains filtered or unexported fields
}

func WithEnvironment

func WithEnvironment(name string, value string) *EnvCustomizer

func (*EnvCustomizer) Customize

func (c *EnvCustomizer) Customize(req *testcontainers.GenericContainerRequest)

type MatrixClient

type MatrixClient struct {
	AccessToken     string
	ClientServerUrl string
	UserId          string
	ServerName      string
}

func (*MatrixClient) DoExpectError

func (c *MatrixClient) DoExpectError(method string, endpoint string, qs url.Values, contentType string, body io.Reader) (*MatrixErrorResponse, error)

func (*MatrixClient) DoRaw

func (c *MatrixClient) DoRaw(method string, endpoint string, qs url.Values, contentType string, body io.Reader) (*http.Response, error)

func (*MatrixClient) DoReturnJson

func (c *MatrixClient) DoReturnJson(method string, endpoint string, qs url.Values, contentType string, body io.Reader, retVal interface{}) error

func (*MatrixClient) Upload

func (c *MatrixClient) Upload(filename string, contentType string, body io.Reader) (*MatrixUploadResponse, error)

func (*MatrixClient) WithCsUrl

func (c *MatrixClient) WithCsUrl(newUrl string) *MatrixClient

type MatrixCreatedMediaResponse

type MatrixCreatedMediaResponse struct {
	*MatrixUploadResponse
	ExpiresTs int64 `json:"unused_expires_at"`
}

type MatrixErrorResponse

type MatrixErrorResponse struct {
	InjectedStatusCode int
	Code               string `json:"errcode"`
	Message            string `json:"error"` // optional
}

type MatrixUploadResponse

type MatrixUploadResponse struct {
	MxcUri string `json:"content_uri"`
}

type MinioDep

type MinioDep struct {
	Endpoint         string
	ExternalEndpoint string
	// contains filtered or unexported fields
}

func MakeMinio

func MakeMinio(depNet *NetworkDep) (*MinioDep, error)

func (*MinioDep) Teardown

func (c *MinioDep) Teardown()

type NetworkDep

type NetworkDep struct {
	NetId string
	// contains filtered or unexported fields
}

func MakeNetwork

func MakeNetwork() (*NetworkDep, error)

func (*NetworkDep) ApplyToContainer

func (n *NetworkDep) ApplyToContainer() testcontainers.ContainerCustomizer

func (*NetworkDep) Teardown

func (n *NetworkDep) Teardown()

type SynapseDep

type SynapseDep struct {
	InternalClientServerApiUrl string
	ExternalClientServerApiUrl string
	ServerName                 string

	AdminUsers        []*MatrixClient // uses ExternalClientServerApiUrl
	UnprivilegedUsers []*MatrixClient // uses ExternalClientServerApiUrl
	// contains filtered or unexported fields
}

func MakeSynapse

func MakeSynapse(domainName string, depNet *NetworkDep) (*SynapseDep, error)

func (*SynapseDep) Teardown

func (c *SynapseDep) Teardown()

Jump to

Keyboard shortcuts

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