mocks

package
v0.0.0-...-f08e3d1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllUsers

type AllUsers struct {
	AllUserGUIDsCall struct {
		Receives struct {
			Token string
		}
		Returns struct {
			GUIDs []string
			Error error
		}
	}
}

func NewAllUsers

func NewAllUsers() *AllUsers

func (*AllUsers) AllUserGUIDs

func (au *AllUsers) AllUserGUIDs(token string) ([]string, error)

type Authenticator

type Authenticator struct {
	ServeHTTPCall struct {
		Receives struct {
			Writer  http.ResponseWriter
			Request *http.Request
			Context stack.Context
		}
		Returns struct {
			Continue bool
		}
	}
}

func (*Authenticator) ServeHTTP

func (a *Authenticator) ServeHTTP(writer http.ResponseWriter, request *http.Request, context stack.Context) bool

type ClientsRepository

type ClientsRepository struct {
	FindCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			ClientID   string
		}
		Returns struct {
			Client models.Client
			Error  error
		}
	}

	FindAllCall struct {
		Receives struct {
			Connection models.ConnectionInterface
		}
		Returns struct {
			Clients []models.Client
			Error   error
		}
	}

	FindAllByTemplateIDCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			TemplateID string
		}
		Returns struct {
			Clients []models.Client
			Error   error
		}
	}

	UpdateCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			Client     models.Client
		}
		Returns struct {
			Client models.Client
			Error  error
		}
	}

	UpsertCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			Client     models.Client
		}
		Returns struct {
			Client models.Client
			Error  error
		}
	}
}

func NewClientsRepository

func NewClientsRepository() *ClientsRepository

func (*ClientsRepository) Find

func (*ClientsRepository) FindAll

func (*ClientsRepository) FindAllByTemplateID

func (cr *ClientsRepository) FindAllByTemplateID(conn models.ConnectionInterface, templateID string) ([]models.Client, error)

func (*ClientsRepository) Update

func (*ClientsRepository) Upsert

type Cloak

type Cloak struct {
	VeilCall struct {
		Receives struct {
			PlainText []byte
		}
		Returns struct {
			CipherText []byte
			Error      error
		}
	}

	UnveilCall struct {
		Receives struct {
			CipherText []byte
		}
		Returns struct {
			PlainText []byte
			Error     error
		}
	}
}

func NewCloak

func NewCloak() *Cloak

func (*Cloak) Unveil

func (c *Cloak) Unveil(ciphertext []byte) ([]byte, error)

func (*Cloak) Veil

func (c *Cloak) Veil(plaintext []byte) ([]byte, error)

type Clock

type Clock struct {
	NowCall struct {
		Returns struct {
			Time time.Time
		}
	}
}

func NewClock

func NewClock() *Clock

func (*Clock) Now

func (c *Clock) Now() time.Time

type CloudController

type CloudController struct {
	GetAuditorsByOrgGuidCall struct {
		Receives struct {
			OrgGUID string
			Token   string
		}
		Returns struct {
			Users []cf.CloudControllerUser
			Error error
		}
	}

	GetBillingManagersByOrgGuidCall struct {
		Receives struct {
			OrgGUID string
			Token   string
		}
		Returns struct {
			Users []cf.CloudControllerUser
			Error error
		}
	}

	GetManagersByOrgGuidCall struct {
		Receives struct {
			OrgGUID string
			Token   string
		}
		Returns struct {
			Users []cf.CloudControllerUser
			Error error
		}
	}

	GetUsersByOrgGuidCall struct {
		Receives struct {
			OrgGUID string
			Token   string
		}
		Returns struct {
			Users []cf.CloudControllerUser
			Error error
		}
	}

	GetUsersBySpaceGuidCall struct {
		Receives struct {
			SpaceGUID string
			Token     string
		}
		Returns struct {
			Users []cf.CloudControllerUser
			Error error
		}
	}

	LoadOrganizationCall struct {
		Receives struct {
			OrgGUID string
			Token   string
		}
		Returns struct {
			Organization cf.CloudControllerOrganization
			Error        error
		}
	}

	LoadSpaceCall struct {
		Receives struct {
			SpaceGUID string
			Token     string
		}
		Returns struct {
			Space cf.CloudControllerSpace
			Error error
		}
	}
}

func NewCloudController

func NewCloudController() *CloudController

func (*CloudController) GetAuditorsByOrgGuid

func (cc *CloudController) GetAuditorsByOrgGuid(orgGUID, token string) ([]cf.CloudControllerUser, error)

func (*CloudController) GetBillingManagersByOrgGuid

func (cc *CloudController) GetBillingManagersByOrgGuid(orgGUID, token string) ([]cf.CloudControllerUser, error)

func (*CloudController) GetManagersByOrgGuid

func (cc *CloudController) GetManagersByOrgGuid(orgGUID, token string) ([]cf.CloudControllerUser, error)

func (*CloudController) GetUsersByOrgGuid

func (cc *CloudController) GetUsersByOrgGuid(orgGUID, token string) ([]cf.CloudControllerUser, error)

func (*CloudController) GetUsersBySpaceGuid

func (cc *CloudController) GetUsersBySpaceGuid(spaceGUID, token string) ([]cf.CloudControllerUser, error)

func (*CloudController) LoadOrganization

func (cc *CloudController) LoadOrganization(orgGUID, token string) (cf.CloudControllerOrganization, error)

func (*CloudController) LoadSpace

func (cc *CloudController) LoadSpace(spaceGUID, token string) (cf.CloudControllerSpace, error)

type Connection

type Connection struct {
	DeleteCall struct {
		Receives struct {
			List []interface{}
		}
		Returns struct {
			Count int64
			Error error
		}
	}

	ExecCall struct {
		Receives struct {
			Query  string
			Params []interface{}
		}
		Returns struct {
			Result sql.Result
			Error  error
		}
	}

	GetCall struct {
		Receives struct {
			Object interface{}
			Keys   []interface{}
		}
		Returns struct {
			Object interface{}
			Error  error
		}
	}

	InsertCall struct {
		Receives struct {
			List []interface{}
		}
		Returns struct {
			Error error
		}
	}

	SelectCall struct {
		Receives struct {
			ResultType interface{}
			Query      string
			Params     []interface{}
		}
		Returns struct {
			Results []interface{}
			Error   error
		}
	}

	SelectOneCall struct {
		Receives struct {
			Result interface{}
			Query  string
			Params []interface{}
		}
		Returns struct {
			Error error
		}
	}

	TransactionCall struct {
		Returns struct {
			Transaction db.TransactionInterface
		}
	}

	UpdateCall struct {
		Receives struct {
			List []interface{}
		}
		Returns struct {
			Count int64
			Error error
		}
	}

	GetDbMapCall struct {
		WasCalled bool
		Returns   struct {
			DbMap *gorp.DbMap
		}
	}
}

func NewConnection

func NewConnection() *Connection

func (*Connection) Delete

func (c *Connection) Delete(list ...interface{}) (int64, error)

func (*Connection) Exec

func (c *Connection) Exec(query string, params ...interface{}) (sql.Result, error)

func (*Connection) Get

func (c *Connection) Get(object interface{}, keys ...interface{}) (interface{}, error)

func (*Connection) GetDbMap

func (c *Connection) GetDbMap() *gorp.DbMap

func (*Connection) Insert

func (c *Connection) Insert(list ...interface{}) error

func (*Connection) Select

func (c *Connection) Select(resultType interface{}, query string, params ...interface{}) ([]interface{}, error)

func (*Connection) SelectOne

func (c *Connection) SelectOne(result interface{}, query string, params ...interface{}) error

func (*Connection) Transaction

func (c *Connection) Transaction() db.TransactionInterface

func (*Connection) Update

func (c *Connection) Update(list ...interface{}) (int64, error)

type Database

type Database struct {
	ConnectionCall struct {
		Returns struct {
			Connection db.ConnectionInterface
		}
	}

	RawConnectionCall struct {
		Returns struct {
			DB *sql.DB
		}
	}

	TraceOnCall struct {
		Receives struct {
			Prefix string
			Logger gorp.GorpLogger
		}
	}
}

func NewDatabase

func NewDatabase() *Database

func (*Database) Connection

func (d *Database) Connection() db.ConnectionInterface

func (*Database) RawConnection

func (d *Database) RawConnection() *sql.DB

func (*Database) TraceOn

func (d *Database) TraceOn(prefix string, logger gorp.GorpLogger)

type DatabaseMigrator

type DatabaseMigrator struct {
	MigrateCall struct {
		Called   bool
		Receives struct {
			DB             *sql.DB
			MigrationsPath string
		}
	}

	SeedCall struct {
		Called   bool
		Receives struct {
			Database            models.DatabaseInterface
			DefaultTemplatePath string
		}
	}
}

func NewDatabaseMigrator

func NewDatabaseMigrator() *DatabaseMigrator

func (*DatabaseMigrator) Migrate

func (d *DatabaseMigrator) Migrate(db *sql.DB, migrationsPath string)

func (*DatabaseMigrator) Seed

func (d *DatabaseMigrator) Seed(database models.DatabaseInterface, defaultTemplatePath string)

type DeliveryFailureHandler

type DeliveryFailureHandler struct {
	HandleCall struct {
		WasCalled bool
		Receives  struct {
			Job    common.Retryable
			Logger lager.Logger
		}
	}
}

func NewDeliveryFailureHandler

func NewDeliveryFailureHandler() *DeliveryFailureHandler

func (*DeliveryFailureHandler) Handle

func (h *DeliveryFailureHandler) Handle(job common.Retryable, logger lager.Logger)

type Enqueuer

type Enqueuer struct {
	EnqueueCall struct {
		WasCalled bool
		Receives  struct {
			Connection      services.ConnectionInterface
			Users           []services.User
			Options         services.Options
			Space           cf.CloudControllerSpace
			Org             cf.CloudControllerOrganization
			Client          string
			Scope           string
			VCAPRequestID   string
			RequestReceived time.Time
			UAAHost         string
		}
		Returns struct {
			Responses []services.Response
			Err       error
		}
	}
}

func NewEnqueuer

func NewEnqueuer() *Enqueuer

func (*Enqueuer) Enqueue

func (m *Enqueuer) Enqueue(
	conn services.ConnectionInterface,
	users []services.User,
	options services.Options,
	space cf.CloudControllerSpace,
	org cf.CloudControllerOrganization,
	client string,
	uaaHost string,
	scope string,
	vcapRequestID string,
	reqReceived time.Time) ([]services.Response, error)

type ErrorWriter

type ErrorWriter struct {
	WriteCall struct {
		Receives struct {
			Writer http.ResponseWriter
			Error  error
		}
	}
}

func NewErrorWriter

func NewErrorWriter() *ErrorWriter

func (*ErrorWriter) Write

func (ew *ErrorWriter) Write(writer http.ResponseWriter, err error)

type FindsUserIDs

type FindsUserIDs struct {
	UserIDsBelongingToOrganizationCall struct {
		Receives struct {
			OrgGUID string
			Role    string
			Token   string
		}
		Returns struct {
			UserIDs []string
			Error   error
		}
	}

	UserIDsBelongingToScopeCall struct {
		Receives struct {
			Token string
			Scope string
		}
		Returns struct {
			UserIDs []string
			Error   error
		}
	}

	UserIDsBelongingToSpaceCall struct {
		Receives struct {
			SpaceGUID string
			Token     string
		}
		Returns struct {
			UserIDs []string
			Error   error
		}
	}
}

func NewFindsUserIDs

func NewFindsUserIDs() *FindsUserIDs

func (*FindsUserIDs) UserIDsBelongingToOrganization

func (f *FindsUserIDs) UserIDsBelongingToOrganization(orgGUID, role, token string) ([]string, error)

func (*FindsUserIDs) UserIDsBelongingToScope

func (f *FindsUserIDs) UserIDsBelongingToScope(token, scope string) ([]string, error)

func (*FindsUserIDs) UserIDsBelongingToSpace

func (f *FindsUserIDs) UserIDsBelongingToSpace(spaceGUID, token string) ([]string, error)

type GlobalUnsubscribesRepo

type GlobalUnsubscribesRepo struct {
	GetCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			UserID     string
		}
		Returns struct {
			Unsubscribed bool
			Error        error
		}
	}

	SetCall struct {
		Receives struct {
			Connection   models.ConnectionInterface
			UserID       string
			Unsubscribed bool
		}
		Returns struct {
			Error error
		}
	}
}

func NewGlobalUnsubscribesRepo

func NewGlobalUnsubscribesRepo() *GlobalUnsubscribesRepo

func (*GlobalUnsubscribesRepo) Get

func (*GlobalUnsubscribesRepo) Set

func (r *GlobalUnsubscribesRepo) Set(conn models.ConnectionInterface, userID string, unsubscribed bool) error

type GobbleDatabase

type GobbleDatabase struct {
	MigrateCall struct {
		WasCalled bool
		Receives  struct {
			MigrationsDir string
		}
	}
}

func (*GobbleDatabase) Migrate

func (gd *GobbleDatabase) Migrate(migrationsDir string)

type GobbleInitializer

type GobbleInitializer struct {
	InitializeDBMapCall struct {
		Receives struct {
			DbMap *gorp.DbMap
		}
	}
}

func NewGobbleInitializer

func NewGobbleInitializer() *GobbleInitializer

func (*GobbleInitializer) InitializeDBMap

func (m *GobbleInitializer) InitializeDBMap(dbmap *gorp.DbMap)

type GobbleJob

type GobbleJob struct {
	RetryCall struct {
		WasCalled bool
		Receives  struct {
			Duration time.Duration
		}
	}

	StateCall struct {
		Returns struct {
			Count int
			Time  time.Time
		}
	}
}

func NewGobbleJob

func NewGobbleJob() *GobbleJob

func (*GobbleJob) Retry

func (j *GobbleJob) Retry(duration time.Duration)

func (*GobbleJob) State

func (j *GobbleJob) State() (int, time.Time)

type HTMLExtractor

type HTMLExtractor struct {
	ExtractCall struct {
		Returns struct {
			Error error
		}
	}
}

func NewHTMLExtractor

func NewHTMLExtractor() *HTMLExtractor

func (HTMLExtractor) Extract

func (e HTMLExtractor) Extract(html string) (doctype, head, bodyContent, bodyAttributes string, err error)

type IDGenerator

type IDGenerator struct {
	GenerateCall struct {
		CallCount int
		Returns   struct {
			IDs   []string
			Error error
		}
	}
}

func NewIDGenerator

func NewIDGenerator() *IDGenerator

func (*IDGenerator) Generate

func (g *IDGenerator) Generate() (string, error)

type KeyFetcher

type KeyFetcher struct {
	GetSigningKeysCall struct {
		Called  bool
		Returns struct {
			Keys  []warrant.SigningKey
			Error error
		}
	}
}

func (*KeyFetcher) GetSigningKeys

func (f *KeyFetcher) GetSigningKeys() ([]warrant.SigningKey, error)

type KindsRepo

type KindsRepo struct {
	FindCall struct {
		CallCount int
		Receives  struct {
			Connection models.ConnectionInterface
			KindID     string
			ClientID   string
		}
		Returns struct {
			Kinds []models.Kind
			Error error
		}
	}

	FindAllCall struct {
		Receives struct {
			Connection models.ConnectionInterface
		}
		Returns struct {
			Kinds []models.Kind
			Error error
		}
	}

	FindAllByTemplateIDCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			TemplateID string
		}
		Returns struct {
			Kinds []models.Kind
			Error error
		}
	}

	TrimCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			ClientID   string
			KindIDs    []string
		}
		Returns struct {
			AffectedRowCount int
			Error            error
		}
	}

	UpdateCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			Kind       models.Kind
		}
		Returns struct {
			Kind  models.Kind
			Error error
		}
	}

	UpsertCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			Kinds      []models.Kind
		}
		Returns struct {
			Kind  models.Kind
			Error error
		}
	}
}

func NewKindsRepo

func NewKindsRepo() *KindsRepo

func (*KindsRepo) Find

func (kr *KindsRepo) Find(conn models.ConnectionInterface, kindID, clientID string) (models.Kind, error)

func (*KindsRepo) FindAll

func (kr *KindsRepo) FindAll(conn models.ConnectionInterface) ([]models.Kind, error)

func (*KindsRepo) FindAllByTemplateID

func (kr *KindsRepo) FindAllByTemplateID(conn models.ConnectionInterface, templateID string) ([]models.Kind, error)

func (*KindsRepo) Trim

func (kr *KindsRepo) Trim(conn models.ConnectionInterface, clientID string, kindIDs []string) (int, error)

func (*KindsRepo) Update

func (kr *KindsRepo) Update(conn models.ConnectionInterface, kind models.Kind) (models.Kind, error)

func (*KindsRepo) Upsert

func (kr *KindsRepo) Upsert(conn models.ConnectionInterface, kind models.Kind) (models.Kind, error)

type MailClient

type MailClient struct {
	ConnectCall struct {
		Receives struct {
			Logger lager.Logger
		}
		Returns struct {
			Error error
		}
	}

	SendCall struct {
		CallCount int
		Receives  struct {
			Message mail.Message
			Logger  lager.Logger
		}
		Returns struct {
			Error error
		}
	}
}

func NewMailClient

func NewMailClient() *MailClient

func (*MailClient) Connect

func (mc *MailClient) Connect(logger lager.Logger) error

func (*MailClient) Send

func (mc *MailClient) Send(message mail.Message, logger lager.Logger) error

type MessageFinder

type MessageFinder struct {
	FindCall struct {
		Receives struct {
			Database  services.DatabaseInterface
			MessageID string
		}
		Returns struct {
			Message services.Message
			Error   error
		}
	}
}

func NewMessageFinder

func NewMessageFinder() *MessageFinder

func (*MessageFinder) Find

func (f *MessageFinder) Find(database services.DatabaseInterface, messageID string) (services.Message, error)

type MessageStatusUpdater

type MessageStatusUpdater struct {
	UpdateCall struct {
		Receives struct {
			Connection    db.ConnectionInterface
			MessageID     string
			MessageStatus string
			CampaignID    string
			Logger        lager.Logger
		}
	}
}

func NewMessageStatusUpdater

func NewMessageStatusUpdater() *MessageStatusUpdater

func (*MessageStatusUpdater) Update

func (msu *MessageStatusUpdater) Update(conn db.ConnectionInterface, messageID, messageStatus, campaignID string, logger lager.Logger)

type MessagesRepo

type MessagesRepo struct {
	UpsertCall struct {
		CallCount int
		Receives  struct {
			Connection models.ConnectionInterface
			Messages   []models.Message
		}
		Returns struct {
			Messages []models.Message
			Error    error
		}
	}

	UpdateCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			Messages   []models.Message
		}
		Returns struct {
			Message models.Message
			Error   error
		}
	}

	FindByIDCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			MessageID  string
		}
		Returns struct {
			Message models.Message
			Error   error
		}
	}

	DeleteBeforeCall struct {
		InvocationTimes []time.Time
		CallCount       int
		Receives        struct {
			Connection    models.ConnectionInterface
			ThresholdTime time.Time
		}
		Returns struct {
			RowsAffected int
			Error        error
		}
	}
}

func NewMessagesRepo

func NewMessagesRepo() *MessagesRepo

func (*MessagesRepo) DeleteBefore

func (mr *MessagesRepo) DeleteBefore(conn models.ConnectionInterface, thresholdTime time.Time) (int, error)

func (*MessagesRepo) FindByID

func (mr *MessagesRepo) FindByID(conn models.ConnectionInterface, messageID string) (models.Message, error)

func (*MessagesRepo) Update

func (*MessagesRepo) Upsert

type MetricsEmitter

type MetricsEmitter struct {
	IncrementCall struct {
		Receives struct {
			Counter string
		}
	}
}

func NewMetricsEmitter

func NewMetricsEmitter() *MetricsEmitter

func (*MetricsEmitter) Increment

func (e *MetricsEmitter) Increment(counter string)

type NotificationUpdater

type NotificationUpdater struct {
	UpdateCall struct {
		Receives struct {
			Database     services.DatabaseInterface
			Notification models.Kind
		}
		Returns struct {
			Error error
		}
	}
}

func (*NotificationUpdater) Update

func (f *NotificationUpdater) Update(database services.DatabaseInterface, notification models.Kind) error

type NotificationsFinder

type NotificationsFinder struct {
	AllClientsAndNotificationsCall struct {
		Receives struct {
			Database services.DatabaseInterface
		}
		Returns struct {
			Clients []models.Client
			Kinds   []models.Kind
			Error   error
		}
	}

	ClientAndKindCall struct {
		Receives struct {
			Database services.DatabaseInterface
			ClientID string
			KindID   string
		}
		Returns struct {
			Client models.Client
			Kind   models.Kind
			Error  error
		}
	}
}

func NewNotificationsFinder

func NewNotificationsFinder() *NotificationsFinder

func (*NotificationsFinder) AllClientsAndNotifications

func (f *NotificationsFinder) AllClientsAndNotifications(database services.DatabaseInterface) ([]models.Client, []models.Kind, error)

func (*NotificationsFinder) ClientAndKind

func (f *NotificationsFinder) ClientAndKind(database services.DatabaseInterface, clientID, kindID string) (models.Client, models.Kind, error)

type Notify

type Notify struct {
	ExecuteCall struct {
		Receives struct {
			Connection    notify.ConnectionInterface
			Request       *http.Request
			Context       stack.Context
			GUID          string
			Strategy      notify.Dispatcher
			Validator     notify.ValidatorInterface
			VCAPRequestID string
		}
		Returns struct {
			Response []byte
			Error    error
		}
	}
}

func NewNotify

func NewNotify() *Notify

func (*Notify) Execute

func (n *Notify) Execute(connection notify.ConnectionInterface, req *http.Request, context stack.Context,
	guid string, strategy notify.Dispatcher, validator notify.ValidatorInterface, vcapRequestID string) ([]byte, error)

type OrgFinder

type OrgFinder struct {
	ExistsCall struct {
		Receives struct {
			GUID string
		}
		Returns struct {
			Exists bool
			Error  error
		}
	}
}

func NewOrgFinder

func NewOrgFinder() *OrgFinder

func (*OrgFinder) Exists

func (f *OrgFinder) Exists(guid string) (bool, error)

type OrganizationLoader

type OrganizationLoader struct {
	LoadCall struct {
		CallCount int
		Receives  struct {
			OrganizationGUID string
			Token            string
		}
		Returns struct {
			Organizations []cf.CloudControllerOrganization
			Errors        []error
		}
	}
}

func NewOrganizationLoader

func NewOrganizationLoader() *OrganizationLoader

func (*OrganizationLoader) Load

func (ol *OrganizationLoader) Load(organizationGUID, token string) (cf.CloudControllerOrganization, error)

type Packager

type Packager struct {
	PrepareContextCall struct {
		Receives struct {
			Delivery common.Delivery
			Sender   string
			Domain   string
		}
		Returns struct {
			MessageContext common.MessageContext
			Error          error
		}
	}

	PackCall struct {
		Receives struct {
			MessageContext common.MessageContext
		}
		Returns struct {
			Message mail.Message
			Error   error
		}
	}
}

func NewPackager

func NewPackager() *Packager

func (*Packager) Pack

func (p *Packager) Pack(context common.MessageContext) (mail.Message, error)

func (*Packager) PrepareContext

func (p *Packager) PrepareContext(delivery common.Delivery, sender, domain string) (common.MessageContext, error)

type PersistenceProvider

type PersistenceProvider struct {
	DatabaseCall struct {
		Returns struct {
			Database db.DatabaseInterface
		}
	}

	GobbleDatabaseCall struct {
		Returns struct {
			Database gobble.DatabaseInterface
		}
	}
}

func NewPersistenceProvider

func NewPersistenceProvider() *PersistenceProvider

func (*PersistenceProvider) Database

func (pp *PersistenceProvider) Database() db.DatabaseInterface

func (*PersistenceProvider) GobbleDatabase

func (pp *PersistenceProvider) GobbleDatabase() gobble.DatabaseInterface

type PreferenceUpdater

type PreferenceUpdater struct {
	UpdateCall struct {
		Receives struct {
			Connection        services.ConnectionInterface
			Preferences       []models.Preference
			GlobalUnsubscribe bool
			UserID            string
		}
		Returns struct {
			Error error
		}
	}
}

func NewPreferenceUpdater

func NewPreferenceUpdater() *PreferenceUpdater

func (*PreferenceUpdater) Update

func (pu *PreferenceUpdater) Update(conn services.ConnectionInterface, preferences []models.Preference, globalUnsubscribe bool, userID string) error

type PreferencesFinder

type PreferencesFinder struct {
	FindCall struct {
		Receives struct {
			Database services.DatabaseInterface
			UserGUID string
		}
		Returns struct {
			PreferencesBuilder services.PreferencesBuilder
			Error              error
		}
	}
}

func NewPreferencesFinder

func NewPreferencesFinder() *PreferencesFinder

func (*PreferencesFinder) Find

type PreferencesRepo

type PreferencesRepo struct {
	FindNonCriticalPreferencesCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			UserGUID   string
		}
		Returns struct {
			Preferences []models.Preference
			Error       error
		}
	}
}

func NewPreferencesRepo

func NewPreferencesRepo() *PreferencesRepo

func (*PreferencesRepo) FindNonCriticalPreferences

func (pr *PreferencesRepo) FindNonCriticalPreferences(conn models.ConnectionInterface, userGUID string) ([]models.Preference, error)

type Queue

type Queue struct {
	EnqueueCall struct {
		Receives struct {
			Jobs       []*gobble.Job
			Connection gobble.ConnectionInterface
		}
		Returns struct {
			Job   *gobble.Job
			Error error
		}

		Hook func()
	}

	RequeueCall struct {
		Receives struct {
			Job *gobble.Job
		}
	}

	DequeueCall struct {
		Receives struct {
			Job *gobble.Job
		}
	}

	LenCall struct {
		Returns struct {
			Length int
			Error  error
		}
	}

	ReserveCall struct {
		Receives struct {
			ID string
		}
		Returns struct {
			Chan <-chan *gobble.Job
		}
	}

	RetryQueueLengthsCall struct {
		Returns struct {
			Lengths map[int]int
			Error   error
		}
	}
}

func NewQueue

func NewQueue() *Queue

func (*Queue) Dequeue

func (q *Queue) Dequeue(job *gobble.Job)

func (*Queue) Enqueue

func (q *Queue) Enqueue(job *gobble.Job, connection gobble.ConnectionInterface) (*gobble.Job, error)

func (*Queue) Len

func (q *Queue) Len() (int, error)

func (*Queue) Requeue

func (q *Queue) Requeue(job *gobble.Job)

func (*Queue) Reserve

func (q *Queue) Reserve(id string) <-chan *gobble.Job

func (*Queue) RetryQueueLengths

func (q *Queue) RetryQueueLengths() (map[int]int, error)

type RainmakerOrganizationsService

type RainmakerOrganizationsService struct {
	GetCall struct {
		Receives struct {
			GUID  string
			Token string
		}
		Returns struct {
			Organization rainmaker.Organization
			Error        error
		}
	}
}

func NewRainmakerOrganizationsService

func NewRainmakerOrganizationsService() *RainmakerOrganizationsService

func (*RainmakerOrganizationsService) Get

type RainmakerSpacesService

type RainmakerSpacesService struct {
	GetCall struct {
		Receives struct {
			GUID  string
			Token string
		}
		Returns struct {
			Space rainmaker.Space
			Error error
		}
	}
}

func NewRainmakerSpacesService

func NewRainmakerSpacesService() *RainmakerSpacesService

func (*RainmakerSpacesService) Get

func (s *RainmakerSpacesService) Get(guid, token string) (rainmaker.Space, error)

type ReceiptsRepo

type ReceiptsRepo struct {
	CreateReceiptsCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			UserGUIDs  []string
			ClientID   string
			KindID     string
		}
		Returns struct {
			Error error
		}
	}
}

func NewReceiptsRepo

func NewReceiptsRepo() *ReceiptsRepo

func (*ReceiptsRepo) CreateReceipts

func (rr *ReceiptsRepo) CreateReceipts(conn models.ConnectionInterface, userGUIDs []string, clientID, kindID string) error

type Registrar

type Registrar struct {
	RegisterCall struct {
		Receives struct {
			Connection services.ConnectionInterface
			Client     models.Client
			Kinds      []models.Kind
		}
		Returns struct {
			Error error
		}
	}

	PruneCall struct {
		Called   bool
		Receives struct {
			Connection services.ConnectionInterface
			Client     models.Client
			Kinds      []models.Kind
		}
		Returns struct {
			Error error
		}
	}
}

func NewRegistrar

func NewRegistrar() *Registrar

func (*Registrar) Prune

func (r *Registrar) Prune(conn services.ConnectionInterface, client models.Client, kinds []models.Kind) error

func (*Registrar) Register

func (r *Registrar) Register(conn services.ConnectionInterface, client models.Client, kinds []models.Kind) error

type SpaceFinder

type SpaceFinder struct {
	ExistsCall struct {
		Receives struct {
			GUID string
		}

		Returns struct {
			Exists bool
			Error  error
		}
	}
}

func NewSpaceFinder

func NewSpaceFinder() *SpaceFinder

func (*SpaceFinder) Exists

func (u *SpaceFinder) Exists(guid string) (bool, error)

type SpaceLoader

type SpaceLoader struct {
	LoadCall struct {
		CallCount int
		Receives  struct {
			SpaceGUID string
			Token     string
		}
		Returns struct {
			Spaces []cf.CloudControllerSpace
			Errors []error
		}
	}
}

func NewSpaceLoader

func NewSpaceLoader() *SpaceLoader

func (*SpaceLoader) Load

func (sl *SpaceLoader) Load(spaceGUID, token string) (cf.CloudControllerSpace, error)

type Strategy

type Strategy struct {
	DispatchCalls      []StrategyDispatchCall
	DispatchCallsCount int
}

func NewStrategy

func NewStrategy() *Strategy

func (*Strategy) Dispatch

func (s *Strategy) Dispatch(dispatch services.Dispatch) ([]services.Response, error)

type StrategyDispatchCall

type StrategyDispatchCall struct {
	Receives struct {
		Dispatch services.Dispatch
	}
	Returns struct {
		Responses []services.Response
		Error     error
	}
}

func NewStrategyDispatchCall

func NewStrategyDispatchCall(responses []services.Response, err error) StrategyDispatchCall

type TemplateAssigner

type TemplateAssigner struct {
	AssignToClientCall struct {
		Receives struct {
			Connection collections.ConnectionInterface
			ClientID   string
			TemplateID string
		}
		Returns struct {
			Error error
		}
	}

	AssignToNotificationCall struct {
		Receives struct {
			Connection     collections.ConnectionInterface
			ClientID       string
			NotificationID string
			TemplateID     string
		}
		Returns struct {
			Error error
		}
	}
}

func NewTemplateAssigner

func NewTemplateAssigner() *TemplateAssigner

func (*TemplateAssigner) AssignToClient

func (a *TemplateAssigner) AssignToClient(connection collections.ConnectionInterface, clientID, templateID string) error

func (*TemplateAssigner) AssignToNotification

func (a *TemplateAssigner) AssignToNotification(connection collections.ConnectionInterface, clientID, notificationID, templateID string) error

type TemplateAssociationLister

type TemplateAssociationLister struct {
	ListCall struct {
		Receives struct {
			Connection collections.ConnectionInterface
			TemplateID string
		}
		Returns struct {
			Associations []collections.TemplateAssociation
			Error        error
		}
	}
}

func NewTemplateAssociationLister

func NewTemplateAssociationLister() *TemplateAssociationLister

func (*TemplateAssociationLister) ListAssociations

func (l *TemplateAssociationLister) ListAssociations(connection collections.ConnectionInterface, templateID string) ([]collections.TemplateAssociation, error)

type TemplateCreator

type TemplateCreator struct {
	CreateCall struct {
		Receives struct {
			Connection collections.ConnectionInterface
			Template   collections.Template
		}
		Returns struct {
			Template collections.Template
			Error    error
		}
	}
}

func NewTemplateCreator

func NewTemplateCreator() *TemplateCreator

func (*TemplateCreator) Create

type TemplateDeleter

type TemplateDeleter struct {
	DeleteCall struct {
		Receives struct {
			Connection collections.ConnectionInterface
			TemplateID string
		}
		Returns struct {
			Error error
		}
	}
}

func NewTemplateDeleter

func NewTemplateDeleter() *TemplateDeleter

func (*TemplateDeleter) Delete

func (td *TemplateDeleter) Delete(connection collections.ConnectionInterface, templateID string) error

type TemplateFinder

type TemplateFinder struct {
	FindByIDCall struct {
		Receives struct {
			Database   services.DatabaseInterface
			TemplateID string
		}
		Returns struct {
			Template models.Template
			Error    error
		}
	}
}

func NewTemplateFinder

func NewTemplateFinder() *TemplateFinder

func (*TemplateFinder) FindByID

func (tf *TemplateFinder) FindByID(database services.DatabaseInterface, templateID string) (models.Template, error)

type TemplateLister

type TemplateLister struct {
	ListCall struct {
		Receives struct {
			Database services.DatabaseInterface
		}
		Returns struct {
			TemplateSummaries map[string]services.TemplateSummary
			Error             error
		}
	}
}

func NewTemplateLister

func NewTemplateLister() *TemplateLister

func (*TemplateLister) List

type TemplateUpdater

type TemplateUpdater struct {
	UpdateCall struct {
		Receives struct {
			Database   services.DatabaseInterface
			TemplateID string
			Template   models.Template
		}
		Returns struct {
			Error error
		}
	}
}

func NewTemplateUpdater

func NewTemplateUpdater() *TemplateUpdater

func (*TemplateUpdater) Update

func (tu *TemplateUpdater) Update(database services.DatabaseInterface, templateID string, template models.Template) error

type TemplatesLoader

type TemplatesLoader struct {
	LoadTemplatesCall struct {
		Receives struct {
			ClientID   string
			KindID     string
			TemplateID string
		}
		Returns struct {
			Templates common.Templates
			Error     error
		}
	}
}

func NewTemplatesLoader

func NewTemplatesLoader() *TemplatesLoader

func (*TemplatesLoader) LoadTemplates

func (tl *TemplatesLoader) LoadTemplates(clientID, kindID, templateID string) (common.Templates, error)

type TemplatesRepo

type TemplatesRepo struct {
	CreateCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			Template   models.Template
		}
		Returns struct {
			Template models.Template
			Error    error
		}
	}

	DestroyCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			TemplateID string
		}
		Returns struct {
			Error error
		}
	}

	FindByIDCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			TemplateID string
		}
		Returns struct {
			Template models.Template
			Error    error
		}
	}

	ListIDsAndNamesCall struct {
		Receives struct {
			Connection models.ConnectionInterface
		}
		Returns struct {
			Templates []models.Template
			Error     error
		}
	}

	UpdateCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			TemplateID string
			Template   models.Template
		}
		Returns struct {
			Template models.Template
			Error    error
		}
	}
}

func NewTemplatesRepo

func NewTemplatesRepo() *TemplatesRepo

func (*TemplatesRepo) Create

func (*TemplatesRepo) Destroy

func (tr *TemplatesRepo) Destroy(conn models.ConnectionInterface, templateID string) error

func (*TemplatesRepo) FindByID

func (tr *TemplatesRepo) FindByID(conn models.ConnectionInterface, templateID string) (models.Template, error)

func (*TemplatesRepo) ListIDsAndNames

func (tr *TemplatesRepo) ListIDsAndNames(conn models.ConnectionInterface) ([]models.Template, error)

func (*TemplatesRepo) Update

func (tr *TemplatesRepo) Update(conn models.ConnectionInterface, templateID string, template models.Template) (models.Template, error)

type TokenLoader

type TokenLoader struct {
	LoadCall struct {
		Receives struct {
			UAAHost string
		}
		Returns struct {
			Token string
			Error error
		}
	}
}

func NewTokenLoader

func NewTokenLoader() *TokenLoader

func (*TokenLoader) Load

func (t *TokenLoader) Load(uaaHost string) (string, error)

type TokenValidator

type TokenValidator struct {
	ParseCall struct {
		Receives struct {
			Token string
		}

		Returns struct {
			Token *jwt.Token
			Error error
		}
	}
}

func (*TokenValidator) Parse

func (t *TokenValidator) Parse(token string) (*jwt.Token, error)

type Transaction

type Transaction struct {
	BeginCall struct {
		WasCalled bool
		Returns   struct {
			Error error
		}
	}

	CommitCall struct {
		WasCalled bool
		Returns   struct {
			Error error
		}
	}

	RollbackCall struct {
		WasCalled bool
		Returns   struct {
			Error error
		}
	}

	*Connection
}

func NewTransaction

func NewTransaction() *Transaction

func (*Transaction) Begin

func (t *Transaction) Begin() error

func (*Transaction) Commit

func (t *Transaction) Commit() error

func (*Transaction) Rollback

func (t *Transaction) Rollback() error

type UnsubscribesRepo

type UnsubscribesRepo struct {
	GetCall struct {
		Receives struct {
			Connection models.ConnectionInterface
			UserID     string
			ClientID   string
			KindID     string
		}
		Returns struct {
			Unsubscribed bool
			Error        error
		}
	}

	SetCall struct {
		Receives struct {
			Connection  models.ConnectionInterface
			UserID      string
			ClientID    string
			KindID      string
			Unsubscribe bool
		}
		Returns struct {
			Error error
		}
	}
}

func NewUnsubscribesRepo

func NewUnsubscribesRepo() *UnsubscribesRepo

func (*UnsubscribesRepo) Get

func (ur *UnsubscribesRepo) Get(conn models.ConnectionInterface, userID, clientID, kindID string) (bool, error)

func (*UnsubscribesRepo) Set

func (ur *UnsubscribesRepo) Set(conn models.ConnectionInterface, userID, clientID, kindID string, unsubscribe bool) error

type UserFinder

type UserFinder struct {
	ExistsCall struct {
		Receives struct {
			GUID string
		}

		Returns struct {
			Exists bool
			Error  error
		}
	}
}

func NewUserFinder

func NewUserFinder() *UserFinder

func (*UserFinder) Exists

func (u *UserFinder) Exists(guid string) (bool, error)

type UserLoader

type UserLoader struct {
	LoadCall struct {
		Receives struct {
			UserGUIDs []string
			Token     string
		}
		Returns struct {
			Users map[string]uaa.User
			Error error
		}
	}
}

func NewUserLoader

func NewUserLoader() *UserLoader

func (*UserLoader) Load

func (ul *UserLoader) Load(userGUIDs []string, token string) (map[string]uaa.User, error)

type V1DeliveryJobProcessor

type V1DeliveryJobProcessor struct {
	ProcessCall struct {
		CallCount int
		Receives  struct {
			Job    *gobble.Job
			Logger lager.Logger
		}
		Returns struct {
			Error error
		}
	}
}

func NewV1DeliveryJobProcessor

func NewV1DeliveryJobProcessor() *V1DeliveryJobProcessor

func (*V1DeliveryJobProcessor) Process

func (p *V1DeliveryJobProcessor) Process(job *gobble.Job, logger lager.Logger) error

type Validator

type Validator struct {
	ValidateCall struct {
		Receives struct {
			Params *notify.NotifyParams
		}
		Returns struct {
			Valid bool
		}
		ErrorsToApply []string
	}
}

func NewValidator

func NewValidator() *Validator

func (*Validator) Validate

func (v *Validator) Validate(params *notify.NotifyParams) bool

type WarrantClientService

type WarrantClientService struct {
	GetTokenCall struct {
		Receives struct {
			ID     string
			Secret string
		}

		Returns struct {
			Token string
			Error error
		}
	}
}

func NewWarrantClientService

func NewWarrantClientService() *WarrantClientService

func (*WarrantClientService) GetToken

func (s *WarrantClientService) GetToken(id, secret string) (string, error)

type WarrantUserService

type WarrantUserService struct {
	GetCall struct {
		Receives struct {
			GUID  string
			Token string
		}

		Returns struct {
			User  warrant.User
			Error error
		}
	}
}

func NewWarrantUserService

func NewWarrantUserService() *WarrantUserService

func (*WarrantUserService) Get

func (s *WarrantUserService) Get(guid, token string) (warrant.User, error)

type ZonedUAAClient

type ZonedUAAClient struct {
	AllUsersCall struct {
		Receives struct {
			Token string
		}
		Returns struct {
			Users []uaa.User
			Error error
		}
	}

	UsersGUIDsByScopeCall struct {
		Receives struct {
			Token string
			Scope string
		}
		Returns struct {
			UserGUIDs []string
			Error     error
		}
	}

	GetClientTokenCall struct {
		Receives struct {
			Host string
		}
		Returns struct {
			Token string
			Error error
		}
	}

	UsersEmailsByIDsCall struct {
		Receives struct {
			Token string
			IDs   []string
		}
		Returns struct {
			Users []uaa.User
			Error error
		}
	}
}

func NewZonedUAAClient

func NewZonedUAAClient() *ZonedUAAClient

func (*ZonedUAAClient) AllUsers

func (c *ZonedUAAClient) AllUsers(token string) ([]uaa.User, error)

func (*ZonedUAAClient) GetClientToken

func (c *ZonedUAAClient) GetClientToken(host string) (string, error)

func (*ZonedUAAClient) UsersEmailsByIDs

func (c *ZonedUAAClient) UsersEmailsByIDs(token string, ids ...string) ([]uaa.User, error)

func (*ZonedUAAClient) UsersGUIDsByScope

func (c *ZonedUAAClient) UsersGUIDsByScope(token, scope string) ([]string, error)

Jump to

Keyboard shortcuts

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