helper

package
v0.0.0-...-6f95374 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: MIT Imports: 29 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 GetAPIKey

func GetAPIKey(t *testing.T) string

func GetAppAPIEndpoint

func GetAppAPIEndpoint(t *testing.T) string

func GetAppCoreEndpoint

func GetAppCoreEndpoint(t *testing.T) string

func GetDSN

func GetDSN(t *testing.T) string

func GetRedisURL

func GetRedisURL(t *testing.T) string

func NewIDs

func NewIDs(t *testing.T, count int) []uuid.UUID

func Public

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

func ToIntPointer

func ToIntPointer(t *testing.T, value int) *int

func ToStringPointer

func ToStringPointer(t *testing.T, value string) *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 ConnectClient

func NewConnectClient

func NewConnectClient(t *testing.T, client connect.HTTPClient, 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 Database

type Database struct {
	T *testing.T
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(
	t *testing.T,
	dsn string,
) *Database

func (*Database) BulkDeleteArticles

func (db *Database) BulkDeleteArticles(ids []uuid.UUID)

func (*Database) BulkInsertArticles

func (db *Database) BulkInsertArticles(ids []uuid.UUID)

func (*Database) Close

func (db *Database) Close()

func (*Database) DeleteArticleByTitle

func (db *Database) DeleteArticleByTitle(title string)

func (*Database) DeleteUser

func (db *Database) DeleteUser(uid uuid.UUID)

func (*Database) DeleteUserArticle

func (db *Database) DeleteUserArticle(
	uid uuid.UUID,
	aid uuid.UUID,
)

func (*Database) InsertUser

func (db *Database) InsertUser(uid uuid.UUID)

func (*Database) SelectArticleByTitle

func (db *Database) SelectArticleByTitle(title string) *ent.Article

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

func NewOpenAPIClientWithAPIKey

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

type Redis

type Redis struct {
	T *testing.T
	// contains filtered or unexported fields
}

func NewRedis

func NewRedis(
	t *testing.T,
	url string,
) *Redis

func (*Redis) Close

func (rds *Redis) Close()

func (*Redis) DeleteInvitationCode

func (rds *Redis) DeleteInvitationCode(
	code string,
)

type User

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

func NewUser

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

func (User) Delete

func (user User) Delete(t *testing.T)

func (User) Sign

func (user User) Sign(code string) string

Jump to

Keyboard shortcuts

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