helper

package
v0.0.0-...-46fdcb5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractUserID

func ExtractUserID(t *testing.T, cookies []*http.Cookie) string

func GenerateIDs

func GenerateIDs(t *testing.T, count int) []string

func GetAPIEndpoint

func GetAPIEndpoint(t *testing.T) string

func GetAPIKey

func GetAPIKey(t *testing.T) string

func GetCoreEndpoint

func GetCoreEndpoint(t *testing.T) string

func GetDSN

func GetDSN(t *testing.T) string

func Public

func Public(t *testing.T, private *rsa.PrivateKey) string

Types

type APIKeyTransport

type APIKeyTransport struct {
	APIKey    string
	Transport http.RoundTripper
	// contains filtered or unexported fields
}

func NewAPIKeyTransport

func NewAPIKeyTransport(
	t *testing.T,
	key string,
) *APIKeyTransport

func (*APIKeyTransport) RoundTrip

func (at *APIKeyTransport) RoundTrip(req *http.Request) (*http.Response, error)

type ArticleDB

type ArticleDB struct {
	T      *testing.T
	Client *ent.Client
}

func NewArticleDB

func NewArticleDB(
	t *testing.T,
	dsn string,
) *ArticleDB

func (ArticleDB) BulkDelete

func (adb ArticleDB) BulkDelete(ids []string)

func (*ArticleDB) BulkInsert

func (adb *ArticleDB) BulkInsert(ids []string)

type ConnectClient

func NewConnectClient

func NewConnectClient(t *testing.T, client connect.HTTPClient, url string) *ConnectClient

func NewConnectClientWithAPIKey

func NewConnectClientWithAPIKey(t *testing.T, key string, url string) *ConnectClient

func NewConnectClientWithCookie

func NewConnectClientWithCookie(t *testing.T, cookie string, url string) *ConnectClient

func NewPlainConnectClient

func NewPlainConnectClient(t *testing.T, url string) *ConnectClient

type CookieTransport

type CookieTransport struct {
	Cookie    string
	Transport http.RoundTripper
	// contains filtered or unexported fields
}

func NewCookieTransport

func NewCookieTransport(
	t *testing.T,
	cookie string,
) *CookieTransport

func (*CookieTransport) RoundTrip

func (ct *CookieTransport) RoundTrip(req *http.Request) (*http.Response, error)

type CookiesTransport

type CookiesTransport struct {
	T         *testing.T
	Cookies   []*http.Cookie
	Transport http.RoundTripper
}

func NewCookiesTransport

func NewCookiesTransport(
	t *testing.T,
	cookies []*http.Cookie,
) *CookiesTransport

func (*CookiesTransport) RoundTrip

func (ct *CookiesTransport) RoundTrip(req *http.Request) (*http.Response, error)

type CoreUser

type CoreUser struct {
	EMail    string
	Password string
	Cookie   string
	Client   *ConnectClient
}

func NewCoreUser

func NewCoreUser(
	t *testing.T,
	url string,
) CoreUser

func (CoreUser) ChangePassword

func (u CoreUser) ChangePassword(t *testing.T, password string) CoreUser

func (CoreUser) Delete

func (u CoreUser) Delete(t *testing.T)

type OnlyIDTokenCookieTransport

type OnlyIDTokenCookieTransport struct {
	T         *testing.T
	Cookie    *http.Cookie
	Transport http.RoundTripper
}

func NewOnlyIDTokenCookieTransport

func NewOnlyIDTokenCookieTransport(
	t *testing.T,
	cookies []*http.Cookie,
) *OnlyIDTokenCookieTransport

func (*OnlyIDTokenCookieTransport) RoundTrip

func (ct *OnlyIDTokenCookieTransport) RoundTrip(req *http.Request) (*http.Response, error)

type OnlySessionTokenCookieTransport

type OnlySessionTokenCookieTransport struct {
	T         *testing.T
	Cookie    *http.Cookie
	Transport http.RoundTripper
}

func NewOnlySessionTokenCookieTransport

func NewOnlySessionTokenCookieTransport(
	t *testing.T,
	cookies []*http.Cookie,
) *OnlySessionTokenCookieTransport

func (*OnlySessionTokenCookieTransport) RoundTrip

type OpenAPIClient

type OpenAPIClient struct {
	Client *openapi.Client
}

func NewOpenAPIClient

func NewOpenAPIClient(t *testing.T, url string) *OpenAPIClient

type User

type User struct {
	T        *testing.T
	EMail    string
	Password string
	Cookies  []*http.Cookie
	Client   *OpenAPIClient
	Key      *rsa.PrivateKey
}

func NewUser

func NewUser(
	t *testing.T,
	url string,
) User

func (*User) Sign

func (user *User) Sign(code string) string

type UserDB

type UserDB struct {
	T      *testing.T
	Client *ent.Client
}

func NewUserDB

func NewUserDB(
	t *testing.T,
	dsn string,
) *UserDB

func (*UserDB) BulkDelete

func (udb *UserDB) BulkDelete(ids []string)

type XAPIKeyTransport

type XAPIKeyTransport struct {
	APIKey    string
	Transport http.RoundTripper
	// contains filtered or unexported fields
}

func NewXAPIKeyTransport

func NewXAPIKeyTransport(
	t *testing.T,
	key string,
) *XAPIKeyTransport

func (*XAPIKeyTransport) RoundTrip

func (at *XAPIKeyTransport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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