mock

package
v0.0.42 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeBaseExtensionImpl

type FakeBaseExtensionImpl struct {
	GetLoggedInUserFn    func(ctx context.Context) (*dto.UserInfo, error)
	GetLoggedInUserUIDFn func(ctx context.Context) (string, error)
	NormalizeMSISDNFn    func(msisdn string) (*string, error)
	LoadDepsFromYAMLFn   func() (*interserviceclient.DepsConfig, error)
	SetupISCclientFn     func(config interserviceclient.DepsConfig, serviceName string) (*interserviceclient.InterServiceClient, error)
	GetEnvVarFn          func(envName string) (string, error)
	EnsureTopicsExistFn  func(
		ctx context.Context,
		pubsubClient *pubsub.Client,
		topicIDs []string,
	) error
	GetRunningEnvironmentFn     func() string
	NamespacePubsubIdentifierFn func(
		serviceName string,
		topicID string,
		environment string,
		version string,
	) string
	PublishToPubsubFn func(
		ctx context.Context,
		pubsubClient *pubsub.Client,
		topicID string,
		environment string,
		serviceName string,
		version string,
		payload []byte,
	) error
	GoogleCloudProjectIDEnvVarNameFn func() (string, error)
	EnsureSubscriptionsExistFn       func(
		ctx context.Context,
		pubsubClient *pubsub.Client,
		topicSubscriptionMap map[string]string,
		callbackURL string,
	) error
	SubscriptionIDsFn                 func(topicIDs []string) map[string]string
	PubSubHandlerPathFn               func() string
	VerifyPubSubJWTAndDecodePayloadFn func(
		w http.ResponseWriter,
		r *http.Request,
	) (*pubsubtools.PubSubPayload, error)
	GetPubSubTopicFn    func(m *pubsubtools.PubSubPayload) (string, error)
	ErrorMapFn          func(err error) map[string]string
	WriteJSONResponseFn func(
		w http.ResponseWriter,
		source interface{},
		status int,
	)
	GetUserProfileByPrimaryPhoneNumberFn func(ctx context.Context, phone string, suspended bool) (*profileutils.UserProfile, error)
}

FakeBaseExtensionImpl is a `base` library fake .

func (*FakeBaseExtensionImpl) EnsureSubscriptionsExist

func (b *FakeBaseExtensionImpl) EnsureSubscriptionsExist(
	ctx context.Context,
	pubsubClient *pubsub.Client,
	topicSubscriptionMap map[string]string,
	callbackURL string,
) error

EnsureSubscriptionsExist ...

func (*FakeBaseExtensionImpl) EnsureTopicsExist

func (b *FakeBaseExtensionImpl) EnsureTopicsExist(
	ctx context.Context,
	pubsubClient *pubsub.Client,
	topicIDs []string,
) error

EnsureTopicsExist ...

func (*FakeBaseExtensionImpl) ErrorMap

func (b *FakeBaseExtensionImpl) ErrorMap(err error) map[string]string

ErrorMap ..

func (*FakeBaseExtensionImpl) GetEnvVar

func (b *FakeBaseExtensionImpl) GetEnvVar(envName string) (string, error)

GetEnvVar ...

func (*FakeBaseExtensionImpl) GetLoggedInUser

func (b *FakeBaseExtensionImpl) GetLoggedInUser(ctx context.Context) (*dto.UserInfo, error)

GetLoggedInUser retrieves logged in user information

func (*FakeBaseExtensionImpl) GetLoggedInUserUID

func (b *FakeBaseExtensionImpl) GetLoggedInUserUID(ctx context.Context) (string, error)

GetLoggedInUserUID ...

func (*FakeBaseExtensionImpl) GetPubSubTopic

func (b *FakeBaseExtensionImpl) GetPubSubTopic(m *pubsubtools.PubSubPayload) (string, error)

GetPubSubTopic ..

func (*FakeBaseExtensionImpl) GetRunningEnvironment

func (b *FakeBaseExtensionImpl) GetRunningEnvironment() string

GetRunningEnvironment ..

func (*FakeBaseExtensionImpl) GetUserProfileByPrimaryPhoneNumber

func (b *FakeBaseExtensionImpl) GetUserProfileByPrimaryPhoneNumber(ctx context.Context, phone string, suspended bool) (*profileutils.UserProfile, error)

GetUserProfileByPrimaryPhoneNumber ..

func (*FakeBaseExtensionImpl) GoogleCloudProjectIDEnvVarName

func (b *FakeBaseExtensionImpl) GoogleCloudProjectIDEnvVarName() (string, error)

GoogleCloudProjectIDEnvVarName ..

func (*FakeBaseExtensionImpl) LoadDepsFromYAML

func (b *FakeBaseExtensionImpl) LoadDepsFromYAML() (*interserviceclient.DepsConfig, error)

LoadDepsFromYAML ...

func (*FakeBaseExtensionImpl) NamespacePubsubIdentifier

func (b *FakeBaseExtensionImpl) NamespacePubsubIdentifier(
	serviceName string,
	topicID string,
	environment string,
	version string,
) string

NamespacePubsubIdentifier ..

func (*FakeBaseExtensionImpl) NormalizeMSISDN

func (b *FakeBaseExtensionImpl) NormalizeMSISDN(msisdn string) (*string, error)

NormalizeMSISDN ...

func (*FakeBaseExtensionImpl) PubSubHandlerPath

func (b *FakeBaseExtensionImpl) PubSubHandlerPath() string

PubSubHandlerPath ..

func (*FakeBaseExtensionImpl) PublishToPubsub

func (b *FakeBaseExtensionImpl) PublishToPubsub(
	ctx context.Context,
	pubsubClient *pubsub.Client,
	topicID string,
	environment string,
	serviceName string,
	version string,
	payload []byte,
) error

PublishToPubsub ..

func (*FakeBaseExtensionImpl) SetupISCclient

SetupISCclient ...

func (*FakeBaseExtensionImpl) SubscriptionIDs

func (b *FakeBaseExtensionImpl) SubscriptionIDs(topicIDs []string) map[string]string

SubscriptionIDs ..

func (*FakeBaseExtensionImpl) VerifyPubSubJWTAndDecodePayload

func (b *FakeBaseExtensionImpl) VerifyPubSubJWTAndDecodePayload(
	w http.ResponseWriter,
	r *http.Request,
) (*pubsubtools.PubSubPayload, error)

VerifyPubSubJWTAndDecodePayload ..

func (*FakeBaseExtensionImpl) WriteJSONResponse

func (b *FakeBaseExtensionImpl) WriteJSONResponse(
	w http.ResponseWriter,
	source interface{},
	status int,
)

WriteJSONResponse ..

type ISCClientExtension

type ISCClientExtension struct {
	MakeRequestFn func(ctx context.Context, method string, path string, body interface{}) (*http.Response, error)
}

ISCClientExtension is an ISC fake

func (*ISCClientExtension) MakeRequest

func (i *ISCClientExtension) MakeRequest(ctx context.Context, method string, path string, body interface{}) (*http.Response, error)

MakeRequest ...

type PINExtensionImpl

type PINExtensionImpl struct {
	EncryptPINFn      func(rawPwd string, options *extension.Options) (string, string)
	ComparePINFn      func(rawPwd string, salt string, encodedPwd string, options *extension.Options) bool
	GenerateTempPINFn func(ctx context.Context) (string, error)
}

PINExtensionImpl is a `PIN` fake .

func (*PINExtensionImpl) ComparePIN

func (p *PINExtensionImpl) ComparePIN(rawPwd string, salt string, encodedPwd string, options *extension.Options) bool

ComparePIN ...

func (*PINExtensionImpl) EncryptPIN

func (p *PINExtensionImpl) EncryptPIN(rawPwd string, options *extension.Options) (string, string)

EncryptPIN ...

func (*PINExtensionImpl) GenerateTempPIN

func (p *PINExtensionImpl) GenerateTempPIN(ctx context.Context) (string, error)

GenerateTempPIN ...

Jump to

Keyboard shortcuts

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