Documentation
¶
Index ¶
- func Mock(method string, path string, status int, response any) *httptest.Server
- type DoSignedResult
- type MockJWKBuilder
- func (b *MockJWKBuilder) Build() was.JsonWebKey
- func (b *MockJWKBuilder) BuildSet() was.JsonWebKeySet
- func (b *MockJWKBuilder) WithAlg(alg was.JsonWebKeyAlg) *MockJWKBuilder
- func (b *MockJWKBuilder) WithCrv(crv was.JsonWebKeyCrv) *MockJWKBuilder
- func (b *MockJWKBuilder) WithKid(kid string) *MockJWKBuilder
- func (b *MockJWKBuilder) WithKty(kty was.JsonWebKeyKty) *MockJWKBuilder
- func (b *MockJWKBuilder) WithX(x string) *MockJWKBuilder
- type MockWalletAddressBuilder
- func (b *MockWalletAddressBuilder) Build() was.WalletAddress
- func (b *MockWalletAddressBuilder) WithAssetCode(assetCode string) *MockWalletAddressBuilder
- func (b *MockWalletAddressBuilder) WithAssetScale(assetScale int) *MockWalletAddressBuilder
- func (b *MockWalletAddressBuilder) WithAuthServer(authServer string) *MockWalletAddressBuilder
- func (b *MockWalletAddressBuilder) WithID(id string) *MockWalletAddressBuilder
- func (b *MockWalletAddressBuilder) WithPublicName(publicName string) *MockWalletAddressBuilder
- func (b *MockWalletAddressBuilder) WithResourceServer(resourceServer string) *MockWalletAddressBuilder
- type Spy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DoSignedResult ¶
DoSignedResult is specific for the DoSigned method.
Go does not support multi-value returns for generics (i.e [T, (R, err)] Consider adding a generic tuple in the future to avoid defining responses for every function that we want to spy on.
Source: https://github.com/golang/go/issues/61920#issuecomment-1676117645
type MockJWKBuilder ¶
type MockJWKBuilder struct {
// contains filtered or unexported fields
}
func NewMockJWKBuilder ¶
func NewMockJWKBuilder() *MockJWKBuilder
func (*MockJWKBuilder) Build ¶
func (b *MockJWKBuilder) Build() was.JsonWebKey
func (*MockJWKBuilder) BuildSet ¶
func (b *MockJWKBuilder) BuildSet() was.JsonWebKeySet
func (*MockJWKBuilder) WithAlg ¶
func (b *MockJWKBuilder) WithAlg(alg was.JsonWebKeyAlg) *MockJWKBuilder
func (*MockJWKBuilder) WithCrv ¶
func (b *MockJWKBuilder) WithCrv(crv was.JsonWebKeyCrv) *MockJWKBuilder
func (*MockJWKBuilder) WithKid ¶
func (b *MockJWKBuilder) WithKid(kid string) *MockJWKBuilder
func (*MockJWKBuilder) WithKty ¶
func (b *MockJWKBuilder) WithKty(kty was.JsonWebKeyKty) *MockJWKBuilder
func (*MockJWKBuilder) WithX ¶
func (b *MockJWKBuilder) WithX(x string) *MockJWKBuilder
type MockWalletAddressBuilder ¶
type MockWalletAddressBuilder struct {
// contains filtered or unexported fields
}
func NewMockWalletAddressBuilder ¶
func NewMockWalletAddressBuilder() *MockWalletAddressBuilder
func (*MockWalletAddressBuilder) Build ¶
func (b *MockWalletAddressBuilder) Build() was.WalletAddress
func (*MockWalletAddressBuilder) WithAssetCode ¶
func (b *MockWalletAddressBuilder) WithAssetCode(assetCode string) *MockWalletAddressBuilder
func (*MockWalletAddressBuilder) WithAssetScale ¶
func (b *MockWalletAddressBuilder) WithAssetScale(assetScale int) *MockWalletAddressBuilder
func (*MockWalletAddressBuilder) WithAuthServer ¶
func (b *MockWalletAddressBuilder) WithAuthServer(authServer string) *MockWalletAddressBuilder
func (*MockWalletAddressBuilder) WithID ¶
func (b *MockWalletAddressBuilder) WithID(id string) *MockWalletAddressBuilder
func (*MockWalletAddressBuilder) WithPublicName ¶
func (b *MockWalletAddressBuilder) WithPublicName(publicName string) *MockWalletAddressBuilder
func (*MockWalletAddressBuilder) WithResourceServer ¶
func (b *MockWalletAddressBuilder) WithResourceServer(resourceServer string) *MockWalletAddressBuilder
type Spy ¶
func SpyOn ¶
SpyOn creates a new Spy for functions with a single input and a single output.
Because of Go's generic constraints, this spy supports only functions of the form: func(T) R
Functions with multiple arguments must wrap their inputs in a struct or tuple Similarly, multiple return values must be wrapped (e.g., using a custom struct or tuples).
This limitation *should* be acceptable for our use case, as we primarily want to spy on request-based functions such as `DoSigned` (Node SDK parity).