auth

package module
v0.0.0-...-62097d3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 15 Imported by: 2

README

auth

Authentication based on event sourcing

Documentation

Index

Constants

View Source
const (
	SendAccountEnabledConfirmationCommand  eventhorizon.CommandType = "SendAccountEnabledConfirmation"
	SendAccountDisabledConfirmationCommand eventhorizon.CommandType = "SendAccountDisabledConfirmation"
	LoginAccountCommand                    eventhorizon.CommandType = "LoginAccount"
	SendAccountCreatedConfirmationCommand  eventhorizon.CommandType = "SendAccountCreatedConfirmation"
	CreateAccountCommand                   eventhorizon.CommandType = "CreateAccount"
	DeleteAccountCommand                   eventhorizon.CommandType = "DeleteAccount"
	EnableAccountCommand                   eventhorizon.CommandType = "EnableAccount"
	DisableAccountCommand                  eventhorizon.CommandType = "DisableAccount"
	UpdateAccountCommand                   eventhorizon.CommandType = "UpdateAccount"
)
View Source
const (
	AccountCreatedEvent                    eventhorizon.EventType = "AccountCreated"
	AccountUpdatedEvent                    eventhorizon.EventType = "AccountUpdated"
	AccountDeletedEvent                    eventhorizon.EventType = "AccountDeleted"
	AccountEnabledEvent                    eventhorizon.EventType = "AccountEnabled"
	AccountDisabledEvent                   eventhorizon.EventType = "AccountDisabled"
	SendEnabledAccountConfirmationedEvent  eventhorizon.EventType = "SendEnabledAccountConfirmationed"
	SendDisabledAccountConfirmationedEvent eventhorizon.EventType = "SendDisabledAccountConfirmationed"
	AccountLoggedEvent                     eventhorizon.EventType = "AccountLogged"
	SendCreatedAccountConfirmationedEvent  eventhorizon.EventType = "SendCreatedAccountConfirmationed"
)
View Source
const AccountAggregateType eventhorizon.AggregateType = "Account"

Variables

This section is empty.

Functions

func AccountCommandTypes

func AccountCommandTypes() *accountCommandTypes

func AccountEventTypes

func AccountEventTypes() *accountEventTypes

Types

type Account

type Account struct {
	Name     *PersonName `json:"name" eh:"optional"`
	Username string      `json:"username" eh:"optional"`
	Password string      `json:"password" eh:"optional"`
	Email    string      `json:"email" eh:"optional"`
	Roles    []string    `json:"roles" eh:"optional"`
	Disabled bool        `json:"disabled" eh:"optional"`
	Id       uuid.UUID   `json:"id" eh:"optional"`
}

func NewAccount

func NewAccount() (ret *Account)

func (*Account) AddToRoles

func (o *Account) AddToRoles(item string) string

func (*Account) EntityID

func (o *Account) EntityID() uuid.UUID

type AccountAggregateInitializer

type AccountAggregateInitializer struct {
	*eh.AggregateInitializer
	*AccountCommandHandler
	*AccountEventHandler
	ProjectorHandler *AccountEventHandler `json:"projectorHandler" eh:"optional"`
}

func NewAccountAggregateInitializer

func NewAccountAggregateInitializer(eventStore eventhorizon.EventStore, eventBus eventhorizon.EventBus, commandBus *bus.CommandHandler,
	readRepos func(string, func() (ret eventhorizon.Entity)) (ret eventhorizon.ReadWriteRepo)) (ret *AccountAggregateInitializer)

func (*AccountAggregateInitializer) RegisterForLogged

func (o *AccountAggregateInitializer) RegisterForLogged(handler eventhorizon.EventHandler)

func (*AccountAggregateInitializer) RegisterForSendCreatedConfirmationed

func (o *AccountAggregateInitializer) RegisterForSendCreatedConfirmationed(handler eventhorizon.EventHandler)

func (*AccountAggregateInitializer) RegisterForSendDisabledConfirmationed

func (o *AccountAggregateInitializer) RegisterForSendDisabledConfirmationed(handler eventhorizon.EventHandler)

func (*AccountAggregateInitializer) RegisterForSendEnabledConfirmationed

func (o *AccountAggregateInitializer) RegisterForSendEnabledConfirmationed(handler eventhorizon.EventHandler)

type AccountCommandHandler

type AccountCommandHandler struct {
	SendEnabledConfirmationHandler  func(*SendAccountEnabledConfirmation, *Account, eh.AggregateStoreEvent) (err error)  `json:"sendEnabledConfirmationHandler" eh:"optional"`
	SendDisabledConfirmationHandler func(*SendAccountDisabledConfirmation, *Account, eh.AggregateStoreEvent) (err error) `json:"sendDisabledConfirmationHandler" eh:"optional"`
	LoginHandler                    func(*LoginAccount, *Account, eh.AggregateStoreEvent) (err error)                    `json:"loginHandler" eh:"optional"`
	SendCreatedConfirmationHandler  func(*SendAccountCreatedConfirmation, *Account, eh.AggregateStoreEvent) (err error)  `json:"sendCreatedConfirmationHandler" eh:"optional"`
	CreateHandler                   func(*CreateAccount, *Account, eh.AggregateStoreEvent) (err error)                   `json:"createHandler" eh:"optional"`
	DeleteHandler                   func(*DeleteAccount, *Account, eh.AggregateStoreEvent) (err error)                   `json:"deleteHandler" eh:"optional"`
	EnableHandler                   func(*EnableAccount, *Account, eh.AggregateStoreEvent) (err error)                   `json:"enableHandler" eh:"optional"`
	DisableHandler                  func(*DisableAccount, *Account, eh.AggregateStoreEvent) (err error)                  `json:"disableHandler" eh:"optional"`
	UpdateHandler                   func(*UpdateAccount, *Account, eh.AggregateStoreEvent) (err error)                   `json:"updateHandler" eh:"optional"`
}

func (*AccountCommandHandler) AddCreatePreparer

func (o *AccountCommandHandler) AddCreatePreparer(preparer func(*CreateAccount, *Account) (err error))

func (*AccountCommandHandler) AddDeletePreparer

func (o *AccountCommandHandler) AddDeletePreparer(preparer func(*DeleteAccount, *Account) (err error))

func (*AccountCommandHandler) AddDisablePreparer

func (o *AccountCommandHandler) AddDisablePreparer(preparer func(*DisableAccount, *Account) (err error))

func (*AccountCommandHandler) AddEnablePreparer

func (o *AccountCommandHandler) AddEnablePreparer(preparer func(*EnableAccount, *Account) (err error))

func (*AccountCommandHandler) AddLoginPreparer

func (o *AccountCommandHandler) AddLoginPreparer(preparer func(*LoginAccount, *Account) (err error))

func (*AccountCommandHandler) AddSendCreatedConfirmationPreparer

func (o *AccountCommandHandler) AddSendCreatedConfirmationPreparer(preparer func(*SendAccountCreatedConfirmation, *Account) (err error))

func (*AccountCommandHandler) AddSendDisabledConfirmationPreparer

func (o *AccountCommandHandler) AddSendDisabledConfirmationPreparer(preparer func(*SendAccountDisabledConfirmation, *Account) (err error))

func (*AccountCommandHandler) AddSendEnabledConfirmationPreparer

func (o *AccountCommandHandler) AddSendEnabledConfirmationPreparer(preparer func(*SendAccountEnabledConfirmation, *Account) (err error))

func (*AccountCommandHandler) AddUpdatePreparer

func (o *AccountCommandHandler) AddUpdatePreparer(preparer func(*UpdateAccount, *Account) (err error))

func (*AccountCommandHandler) Execute

func (*AccountCommandHandler) SetupCommandHandler

func (o *AccountCommandHandler) SetupCommandHandler() (err error)

type AccountCommandType

type AccountCommandType struct {
	// contains filtered or unexported fields
}

func (AccountCommandType) GetBSON

func (o AccountCommandType) GetBSON() (ret interface{}, err error)

func (*AccountCommandType) IsCreateAccount

func (o *AccountCommandType) IsCreateAccount() bool

func (*AccountCommandType) IsDeleteAccount

func (o *AccountCommandType) IsDeleteAccount() bool

func (*AccountCommandType) IsDisableAccount

func (o *AccountCommandType) IsDisableAccount() bool

func (*AccountCommandType) IsEnableAccount

func (o *AccountCommandType) IsEnableAccount() bool

func (*AccountCommandType) IsLoginAccount

func (o *AccountCommandType) IsLoginAccount() bool

func (*AccountCommandType) IsSendAccountCreatedConfirmation

func (o *AccountCommandType) IsSendAccountCreatedConfirmation() bool

func (*AccountCommandType) IsSendAccountDisabledConfirmation

func (o *AccountCommandType) IsSendAccountDisabledConfirmation() bool

func (*AccountCommandType) IsSendAccountEnabledConfirmation

func (o *AccountCommandType) IsSendAccountEnabledConfirmation() bool

func (*AccountCommandType) IsUpdateAccount

func (o *AccountCommandType) IsUpdateAccount() bool

func (AccountCommandType) MarshalJSON

func (o AccountCommandType) MarshalJSON() (ret []byte, err error)

func (*AccountCommandType) Name

func (o *AccountCommandType) Name() string

func (*AccountCommandType) Ordinal

func (o *AccountCommandType) Ordinal() int

func (*AccountCommandType) SetBSON

func (o *AccountCommandType) SetBSON(raw bson.Raw) (err error)

func (*AccountCommandType) UnmarshalJSON

func (o *AccountCommandType) UnmarshalJSON(data []byte) (err error)

type AccountConfirmationDisabledExecutor

type AccountConfirmationDisabledExecutor struct {
}

func NewAccountConfirmationDisabledExecutor

func NewAccountConfirmationDisabledExecutor() (ret *AccountConfirmationDisabledExecutor)

type AccountConfirmationDisabledHandler

type AccountConfirmationDisabledHandler struct {
	EnabledHandler func(*AccountEnabled, *Account) (err error) `json:"enabledHandler" eh:"optional"`
}

func NewAccountConfirmationDisabledHandler

func NewAccountConfirmationDisabledHandler() (ret *AccountConfirmationDisabledHandler)

func (*AccountConfirmationDisabledHandler) Apply

func (*AccountConfirmationDisabledHandler) SetupEventHandler

func (o *AccountConfirmationDisabledHandler) SetupEventHandler() (err error)

type AccountConfirmationEnabledExecutor

type AccountConfirmationEnabledExecutor struct {
}

func NewAccountConfirmationEnabledExecutor

func NewAccountConfirmationEnabledExecutor() (ret *AccountConfirmationEnabledExecutor)

type AccountConfirmationEnabledHandler

type AccountConfirmationEnabledHandler struct {
	DisabledHandler func(*AccountDisabled, *Account) (err error) `json:"disabledHandler" eh:"optional"`
}

func NewAccountConfirmationEnabledHandler

func NewAccountConfirmationEnabledHandler() (ret *AccountConfirmationEnabledHandler)

func (*AccountConfirmationEnabledHandler) Apply

func (*AccountConfirmationEnabledHandler) SetupEventHandler

func (o *AccountConfirmationEnabledHandler) SetupEventHandler() (err error)

type AccountConfirmationExecutors

type AccountConfirmationExecutors struct {
	Disabled *AccountConfirmationDisabledExecutor `json:"disabled" eh:"optional"`
	Enabled  *AccountConfirmationEnabledExecutor  `json:"enabled" eh:"optional"`
	Initial  *AccountConfirmationInitialExecutor  `json:"initial" eh:"optional"`
}

func NewAccountConfirmationExecutors

func NewAccountConfirmationExecutors() (ret *AccountConfirmationExecutors)

type AccountConfirmationHandlers

type AccountConfirmationHandlers struct {
	Disabled *AccountConfirmationDisabledHandler `json:"disabled" eh:"optional"`
	Enabled  *AccountConfirmationEnabledHandler  `json:"enabled" eh:"optional"`
	Initial  *AccountConfirmationInitialHandler  `json:"initial" eh:"optional"`
}

func NewAccountConfirmationHandlers

func NewAccountConfirmationHandlers() (ret *AccountConfirmationHandlers)

type AccountConfirmationInitialExecutor

type AccountConfirmationInitialExecutor struct {
}

func NewAccountConfirmationInitialExecutor

func NewAccountConfirmationInitialExecutor() (ret *AccountConfirmationInitialExecutor)

type AccountConfirmationInitialHandler

type AccountConfirmationInitialHandler struct {
	CreatedHandler func(*AccountCreated, *Account) (err error) `json:"createdHandler" eh:"optional"`
}

func NewAccountConfirmationInitialHandler

func NewAccountConfirmationInitialHandler() (ret *AccountConfirmationInitialHandler)

func (*AccountConfirmationInitialHandler) Apply

func (*AccountConfirmationInitialHandler) SetupEventHandler

func (o *AccountConfirmationInitialHandler) SetupEventHandler() (err error)

type AccountCreated

type AccountCreated struct {
	Name     *PersonName `json:"name" eh:"optional"`
	Username string      `json:"username" eh:"optional"`
	Password string      `json:"password" eh:"optional"`
	Email    string      `json:"email" eh:"optional"`
	Roles    []string    `json:"roles" eh:"optional"`
	Id       uuid.UUID   `json:"id" eh:"optional"`
}

func (*AccountCreated) AddToRoles

func (o *AccountCreated) AddToRoles(item string) string

type AccountDeleted

type AccountDeleted struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

type AccountDeletedExecutor

type AccountDeletedExecutor struct {
}

func NewAccountDeletedExecutor

func NewAccountDeletedExecutor() (ret *AccountDeletedExecutor)

type AccountDeletedHandler

type AccountDeletedHandler struct {
}

func NewAccountDeletedHandler

func NewAccountDeletedHandler() (ret *AccountDeletedHandler)

func (*AccountDeletedHandler) Apply

func (o *AccountDeletedHandler) Apply(event eventhorizon.Event, entity eventhorizon.Entity) (err error)

func (*AccountDeletedHandler) SetupEventHandler

func (o *AccountDeletedHandler) SetupEventHandler() (err error)

type AccountDisabled

type AccountDisabled struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

type AccountDisabledExecutor

type AccountDisabledExecutor struct {
}

func NewAccountDisabledExecutor

func NewAccountDisabledExecutor() (ret *AccountDisabledExecutor)

type AccountDisabledHandler

type AccountDisabledHandler struct {
	EnabledHandler func(*AccountEnabled, *Account) (err error) `json:"enabledHandler" eh:"optional"`
}

func NewAccountDisabledHandler

func NewAccountDisabledHandler() (ret *AccountDisabledHandler)

func (*AccountDisabledHandler) Apply

func (o *AccountDisabledHandler) Apply(event eventhorizon.Event, entity eventhorizon.Entity) (err error)

func (*AccountDisabledHandler) SetupEventHandler

func (o *AccountDisabledHandler) SetupEventHandler() (err error)

type AccountEnabled

type AccountEnabled struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

type AccountEnabledExecutor

type AccountEnabledExecutor struct {
}

func NewAccountEnabledExecutor

func NewAccountEnabledExecutor() (ret *AccountEnabledExecutor)

type AccountEnabledHandler

type AccountEnabledHandler struct {
	DisabledHandler func(*AccountDisabled, *Account) (err error) `json:"disabledHandler" eh:"optional"`
}

func NewAccountEnabledHandler

func NewAccountEnabledHandler() (ret *AccountEnabledHandler)

func (*AccountEnabledHandler) Apply

func (o *AccountEnabledHandler) Apply(event eventhorizon.Event, entity eventhorizon.Entity) (err error)

func (*AccountEnabledHandler) SetupEventHandler

func (o *AccountEnabledHandler) SetupEventHandler() (err error)

type AccountEventHandler

type AccountEventHandler struct {
	CreatedHandler                    func(*AccountCreated, *Account) (err error)                    `json:"createdHandler" eh:"optional"`
	DeletedHandler                    func(*AccountDeleted, *Account) (err error)                    `json:"deletedHandler" eh:"optional"`
	DisabledHandler                   func(*AccountDisabled, *Account) (err error)                   `json:"disabledHandler" eh:"optional"`
	EnabledHandler                    func(*AccountEnabled, *Account) (err error)                    `json:"enabledHandler" eh:"optional"`
	LoggedHandler                     func(*AccountLogged, *Account) (err error)                     `json:"loggedHandler" eh:"optional"`
	SendCreatedConfirmationedHandler  func(*SendCreatedAccountConfirmationed, *Account) (err error)  `json:"sendCreatedConfirmationedHandler" eh:"optional"`
	SendDisabledConfirmationedHandler func(*SendDisabledAccountConfirmationed, *Account) (err error) `json:"sendDisabledConfirmationedHandler" eh:"optional"`
	SendEnabledConfirmationedHandler  func(*SendEnabledAccountConfirmationed, *Account) (err error)  `json:"sendEnabledConfirmationedHandler" eh:"optional"`
	UpdatedHandler                    func(*AccountUpdated, *Account) (err error)                    `json:"updatedHandler" eh:"optional"`
}

func (*AccountEventHandler) Apply

func (o *AccountEventHandler) Apply(event eventhorizon.Event, entity eventhorizon.Entity) (err error)

func (*AccountEventHandler) SetupEventHandler

func (o *AccountEventHandler) SetupEventHandler() (err error)

type AccountEventType

type AccountEventType struct {
	// contains filtered or unexported fields
}

func (AccountEventType) GetBSON

func (o AccountEventType) GetBSON() (ret interface{}, err error)

func (*AccountEventType) IsAccountCreated

func (o *AccountEventType) IsAccountCreated() bool

func (*AccountEventType) IsAccountDeleted

func (o *AccountEventType) IsAccountDeleted() bool

func (*AccountEventType) IsAccountDisabled

func (o *AccountEventType) IsAccountDisabled() bool

func (*AccountEventType) IsAccountEnabled

func (o *AccountEventType) IsAccountEnabled() bool

func (*AccountEventType) IsAccountLogged

func (o *AccountEventType) IsAccountLogged() bool

func (*AccountEventType) IsAccountUpdated

func (o *AccountEventType) IsAccountUpdated() bool

func (*AccountEventType) IsSendCreatedAccountConfirmationed

func (o *AccountEventType) IsSendCreatedAccountConfirmationed() bool

func (*AccountEventType) IsSendDisabledAccountConfirmationed

func (o *AccountEventType) IsSendDisabledAccountConfirmationed() bool

func (*AccountEventType) IsSendEnabledAccountConfirmationed

func (o *AccountEventType) IsSendEnabledAccountConfirmationed() bool

func (AccountEventType) MarshalJSON

func (o AccountEventType) MarshalJSON() (ret []byte, err error)

func (*AccountEventType) Name

func (o *AccountEventType) Name() string

func (*AccountEventType) Ordinal

func (o *AccountEventType) Ordinal() int

func (*AccountEventType) SetBSON

func (o *AccountEventType) SetBSON(raw bson.Raw) (err error)

func (*AccountEventType) UnmarshalJSON

func (o *AccountEventType) UnmarshalJSON(data []byte) (err error)

type AccountExecutors

type AccountExecutors struct {
	Deleted  *AccountDeletedExecutor  `json:"deleted" eh:"optional"`
	Disabled *AccountDisabledExecutor `json:"disabled" eh:"optional"`
	Enabled  *AccountEnabledExecutor  `json:"enabled" eh:"optional"`
	Exist    *AccountExistExecutor    `json:"exist" eh:"optional"`
	Initial  *AccountInitialExecutor  `json:"initial" eh:"optional"`
}

func NewAccountExecutors

func NewAccountExecutors() (ret *AccountExecutors)

type AccountExistExecutor

type AccountExistExecutor struct {
}

func NewAccountExistExecutor

func NewAccountExistExecutor() (ret *AccountExistExecutor)

type AccountExistHandler

type AccountExistHandler struct {
	DeletedHandler func(*AccountDeleted, *Account) (err error) `json:"deletedHandler" eh:"optional"`
	UpdatedHandler func(*AccountUpdated, *Account) (err error) `json:"updatedHandler" eh:"optional"`
}

func NewAccountExistHandler

func NewAccountExistHandler() (ret *AccountExistHandler)

func (*AccountExistHandler) Apply

func (o *AccountExistHandler) Apply(event eventhorizon.Event, entity eventhorizon.Entity) (err error)

func (*AccountExistHandler) SetupEventHandler

func (o *AccountExistHandler) SetupEventHandler() (err error)

type AccountHandlers

type AccountHandlers struct {
	Deleted  *AccountDeletedHandler  `json:"deleted" eh:"optional"`
	Disabled *AccountDisabledHandler `json:"disabled" eh:"optional"`
	Enabled  *AccountEnabledHandler  `json:"enabled" eh:"optional"`
	Exist    *AccountExistHandler    `json:"exist" eh:"optional"`
	Initial  *AccountInitialHandler  `json:"initial" eh:"optional"`
}

func NewAccountHandlers

func NewAccountHandlers() (ret *AccountHandlers)

type AccountHttpCommandHandler

type AccountHttpCommandHandler struct {
	*eh.HttpCommandHandler
}

func NewAccountHttpCommandHandler

func NewAccountHttpCommandHandler(context context.Context, commandBus eventhorizon.CommandHandler) (ret *AccountHttpCommandHandler)

func (*AccountHttpCommandHandler) Create

func (*AccountHttpCommandHandler) Delete

func (*AccountHttpCommandHandler) Disable

func (*AccountHttpCommandHandler) Enable

func (*AccountHttpCommandHandler) Login

func (*AccountHttpCommandHandler) SendCreatedConfirmation

func (o *AccountHttpCommandHandler) SendCreatedConfirmation(w http.ResponseWriter, r *http.Request)

func (*AccountHttpCommandHandler) SendDisabledConfirmation

func (o *AccountHttpCommandHandler) SendDisabledConfirmation(w http.ResponseWriter, r *http.Request)

func (*AccountHttpCommandHandler) SendEnabledConfirmation

func (o *AccountHttpCommandHandler) SendEnabledConfirmation(w http.ResponseWriter, r *http.Request)

func (*AccountHttpCommandHandler) Update

type AccountHttpQueryHandler

type AccountHttpQueryHandler struct {
	*eh.HttpQueryHandler
	QueryRepository *AccountQueryRepository `json:"queryRepository" eh:"optional"`
}

func NewAccountHttpQueryHandler

func NewAccountHttpQueryHandler(queryRepository *AccountQueryRepository) (ret *AccountHttpQueryHandler)

func (*AccountHttpQueryHandler) CountAll

func (*AccountHttpQueryHandler) CountById

func (*AccountHttpQueryHandler) ExistAll

func (*AccountHttpQueryHandler) ExistById

func (*AccountHttpQueryHandler) FindAll

func (*AccountHttpQueryHandler) FindById

type AccountInitialExecutor

type AccountInitialExecutor struct {
}

func NewAccountInitialExecutor

func NewAccountInitialExecutor() (ret *AccountInitialExecutor)

type AccountInitialHandler

type AccountInitialHandler struct {
	CreatedHandler func(*AccountCreated, *Account) (err error) `json:"createdHandler" eh:"optional"`
}

func NewAccountInitialHandler

func NewAccountInitialHandler() (ret *AccountInitialHandler)

func (*AccountInitialHandler) Apply

func (o *AccountInitialHandler) Apply(event eventhorizon.Event, entity eventhorizon.Entity) (err error)

func (*AccountInitialHandler) SetupEventHandler

func (o *AccountInitialHandler) SetupEventHandler() (err error)

type AccountLogged

type AccountLogged struct {
	Username string    `json:"username" eh:"optional"`
	Email    string    `json:"email" eh:"optional"`
	Password string    `json:"password" eh:"optional"`
	Id       uuid.UUID `json:"id" eh:"optional"`
}

type AccountQueryRepository

type AccountQueryRepository struct {
	// contains filtered or unexported fields
}

func NewAccountQueryRepository

func NewAccountQueryRepository(repo eventhorizon.ReadRepo, context context.Context) (ret *AccountQueryRepository)

func (*AccountQueryRepository) CountAll

func (o *AccountQueryRepository) CountAll() (ret int, err error)

func (*AccountQueryRepository) CountById

func (o *AccountQueryRepository) CountById(id uuid.UUID) (ret int, err error)

func (*AccountQueryRepository) ExistAll

func (o *AccountQueryRepository) ExistAll() (ret bool, err error)

func (*AccountQueryRepository) ExistById

func (o *AccountQueryRepository) ExistById(id uuid.UUID) (ret bool, err error)

func (*AccountQueryRepository) FindAll

func (o *AccountQueryRepository) FindAll() (ret []*Account, err error)

func (*AccountQueryRepository) FindById

func (o *AccountQueryRepository) FindById(id uuid.UUID) (ret *Account, err error)

type AccountRouter

type AccountRouter struct {
	PathPrefix     string                     `json:"pathPrefix" eh:"optional"`
	QueryHandler   *AccountHttpQueryHandler   `json:"queryHandler" eh:"optional"`
	CommandHandler *AccountHttpCommandHandler `json:"commandHandler" eh:"optional"`
	Router         *mux.Router                `json:"router" eh:"optional"`
}

func NewAccountRouter

func NewAccountRouter(pathPrefix string, context context.Context, commandBus eventhorizon.CommandHandler,
	readRepos func(string, func() (ret eventhorizon.Entity)) (ret eventhorizon.ReadWriteRepo)) (ret *AccountRouter)

func (*AccountRouter) Setup

func (o *AccountRouter) Setup(router *mux.Router) (err error)

type AccountUpdated

type AccountUpdated struct {
	Name     *PersonName `json:"name" eh:"optional"`
	Username string      `json:"username" eh:"optional"`
	Password string      `json:"password" eh:"optional"`
	Email    string      `json:"email" eh:"optional"`
	Roles    []string    `json:"roles" eh:"optional"`
	Id       uuid.UUID   `json:"id" eh:"optional"`
}

func (*AccountUpdated) AddToRoles

func (o *AccountUpdated) AddToRoles(item string) string

type AuthEventhorizonInitializer

type AuthEventhorizonInitializer struct {
	AccountAggregateInitializer *AccountAggregateInitializer `json:"accountAggregateInitializer" eh:"optional"`
	// contains filtered or unexported fields
}

func NewAuthEventhorizonInitializer

func NewAuthEventhorizonInitializer(eventStore eventhorizon.EventStore, eventBus eventhorizon.EventBus, commandBus *bus.CommandHandler,
	readRepos func(string, func() (ret eventhorizon.Entity)) (ret eventhorizon.ReadWriteRepo)) (ret *AuthEventhorizonInitializer)

func (*AuthEventhorizonInitializer) ActivatePasswordEncryption

func (o *AuthEventhorizonInitializer) ActivatePasswordEncryption()

func (*AuthEventhorizonInitializer) Setup

func (o *AuthEventhorizonInitializer) Setup() (err error)

type AuthRouter

type AuthRouter struct {
	PathPrefix    string         `json:"pathPrefix" eh:"optional"`
	AccountRouter *AccountRouter `json:"accountRouter" eh:"optional"`
	Router        *mux.Router    `json:"router" eh:"optional"`
}

func NewAuthRouter

func NewAuthRouter(pathPrefix string, context context.Context, commandBus *bus.CommandHandler,
	readRepos func(string, func() (ret eventhorizon.Entity)) (ret eventhorizon.ReadWriteRepo)) (ret *AuthRouter)

func (*AuthRouter) Setup

func (o *AuthRouter) Setup(router *mux.Router) (err error)

type CreateAccount

type CreateAccount struct {
	Name     *PersonName `json:"name" eh:"optional"`
	Username string      `json:"username" eh:"optional"`
	Password string      `json:"password" eh:"optional"`
	Email    string      `json:"email" eh:"optional"`
	Roles    []string    `json:"roles" eh:"optional"`
	Id       uuid.UUID   `json:"id" eh:"optional"`
}

func (*CreateAccount) AddToRoles

func (o *CreateAccount) AddToRoles(item string) string

func (*CreateAccount) AggregateID

func (o *CreateAccount) AggregateID() uuid.UUID

func (*CreateAccount) AggregateType

func (o *CreateAccount) AggregateType() eventhorizon.AggregateType

func (*CreateAccount) CommandType

func (o *CreateAccount) CommandType() eventhorizon.CommandType

type DeleteAccount

type DeleteAccount struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

func (*DeleteAccount) AggregateID

func (o *DeleteAccount) AggregateID() uuid.UUID

func (*DeleteAccount) AggregateType

func (o *DeleteAccount) AggregateType() eventhorizon.AggregateType

func (*DeleteAccount) CommandType

func (o *DeleteAccount) CommandType() eventhorizon.CommandType

type DisableAccount

type DisableAccount struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

func (*DisableAccount) AggregateID

func (o *DisableAccount) AggregateID() uuid.UUID

func (*DisableAccount) AggregateType

func (o *DisableAccount) AggregateType() eventhorizon.AggregateType

func (*DisableAccount) CommandType

func (o *DisableAccount) CommandType() eventhorizon.CommandType

type EnableAccount

type EnableAccount struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

func (*EnableAccount) AggregateID

func (o *EnableAccount) AggregateID() uuid.UUID

func (*EnableAccount) AggregateType

func (o *EnableAccount) AggregateType() eventhorizon.AggregateType

func (*EnableAccount) CommandType

func (o *EnableAccount) CommandType() eventhorizon.CommandType

type LoginAccount

type LoginAccount struct {
	Username string    `json:"username" eh:"optional"`
	Email    string    `json:"email" eh:"optional"`
	Password string    `json:"password" eh:"optional"`
	Id       uuid.UUID `json:"id" eh:"optional"`
}

func (*LoginAccount) AggregateID

func (o *LoginAccount) AggregateID() uuid.UUID

func (*LoginAccount) AggregateType

func (o *LoginAccount) AggregateType() eventhorizon.AggregateType

func (*LoginAccount) CommandType

func (o *LoginAccount) CommandType() eventhorizon.CommandType

type PersonName

type PersonName struct {
	First string `json:"first" eh:"optional"`
	Last  string `json:"last" eh:"optional"`
}

func NewPersonName

func NewPersonName() (ret *PersonName)

type SendAccountCreatedConfirmation

type SendAccountCreatedConfirmation struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

func (*SendAccountCreatedConfirmation) AggregateID

func (o *SendAccountCreatedConfirmation) AggregateID() uuid.UUID

func (*SendAccountCreatedConfirmation) AggregateType

func (*SendAccountCreatedConfirmation) CommandType

type SendAccountDisabledConfirmation

type SendAccountDisabledConfirmation struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

func (*SendAccountDisabledConfirmation) AggregateID

func (o *SendAccountDisabledConfirmation) AggregateID() uuid.UUID

func (*SendAccountDisabledConfirmation) AggregateType

func (*SendAccountDisabledConfirmation) CommandType

type SendAccountEnabledConfirmation

type SendAccountEnabledConfirmation struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

func (*SendAccountEnabledConfirmation) AggregateID

func (o *SendAccountEnabledConfirmation) AggregateID() uuid.UUID

func (*SendAccountEnabledConfirmation) AggregateType

func (*SendAccountEnabledConfirmation) CommandType

type SendCreatedAccountConfirmationed

type SendCreatedAccountConfirmationed struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

type SendDisabledAccountConfirmationed

type SendDisabledAccountConfirmationed struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

type SendEnabledAccountConfirmationed

type SendEnabledAccountConfirmationed struct {
	Id uuid.UUID `json:"id" eh:"optional"`
}

type UpdateAccount

type UpdateAccount struct {
	Name     *PersonName `json:"name" eh:"optional"`
	Username string      `json:"username" eh:"optional"`
	Password string      `json:"password" eh:"optional"`
	Email    string      `json:"email" eh:"optional"`
	Roles    []string    `json:"roles" eh:"optional"`
	Id       uuid.UUID   `json:"id" eh:"optional"`
}

func (*UpdateAccount) AddToRoles

func (o *UpdateAccount) AddToRoles(item string) string

func (*UpdateAccount) AggregateID

func (o *UpdateAccount) AggregateID() uuid.UUID

func (*UpdateAccount) AggregateType

func (o *UpdateAccount) AggregateType() eventhorizon.AggregateType

func (*UpdateAccount) CommandType

func (o *UpdateAccount) CommandType() eventhorizon.CommandType

type UserCredentials

type UserCredentials struct {
	Username string `json:"username" eh:"optional"`
	Password string `json:"password" eh:"optional"`
}

func NewUserCredentials

func NewUserCredentials() (ret *UserCredentials)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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