testutils

package
v0.25.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JwkKeyOpts = cmp.Options{
	cmp.FilterValues(func(x, y interface{}) bool {
		_, xOk := x.(jwk.RSAPublicKey)
		_, yOk := y.(jwk.RSAPublicKey)
		return xOk && yOk
	}, cmp.Comparer(func(x, y interface{}) bool {
		xJWK := x.(jwk.RSAPublicKey)
		yJWK := y.(jwk.RSAPublicKey)

		var rawXKey, rawYKey interface{}

		if err := xJWK.Raw(&rawXKey); err != nil {
			return false
		}

		if err := yJWK.Raw(&rawYKey); err != nil {
			return false
		}

		return reflect.DeepEqual(rawXKey, rawYKey) && xJWK.KeyID() == yJWK.KeyID()
	})),
}

Functions

func APIBuild

func APIBuild() *api.Build

func APIDashboard

func APIDashboard() *api.Dashboard

func APIDashboardRepo

func APIDashboardRepo() *api.DashboardRepo

func APIDeployment

func APIDeployment() *library.Deployment

func APIEvents

func APIEvents() *api.Events

func APIHook

func APIHook() *api.Hook

func APILog

func APILog() *library.Log

func APIPipeline

func APIPipeline() *library.Pipeline

func APIRepo

func APIRepo() *api.Repo

func APISchedule

func APISchedule() *api.Schedule

func APIService

func APIService() *library.Service

func APIStep

func APIStep() *library.Step

func APIUser

func APIUser() *api.User

func JWK

func JWK() jwk.RSAPublicKey

Types

type AnyArgument

type AnyArgument struct{}

This will be used with the github.com/DATA-DOG/go-sqlmock library to compare values that are otherwise not easily compared. These typically would be values generated before adding or updating them in the database.

https://github.com/DATA-DOG/go-sqlmock#matching-arguments-like-timetime

func (AnyArgument) Match

func (a AnyArgument) Match(_ driver.Value) bool

Match satisfies sqlmock.Argument interface.

type NowTimestamp

type NowTimestamp struct{}

NowTimestamp is used to test whether timestamps get updated correctly to the current time with lenience.

func (NowTimestamp) Match

func (t NowTimestamp) Match(v driver.Value) bool

Match satisfies sqlmock.Argument interface.

Jump to

Keyboard shortcuts

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