auth

package
v0.0.0-...-67bd749 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SendEnabledConfirmationAccountCommand  eventhorizon.CommandType = "SendEnabledConfirmationAccount"
	SendDisabledConfirmationAccountCommand eventhorizon.CommandType = "SendDisabledConfirmationAccount"
	LoginAccountCommand                    eventhorizon.CommandType = "LoginAccount"
	CreateAccountCommand                   eventhorizon.CommandType = "CreateAccount"
	DeleteAccountCommand                   eventhorizon.CommandType = "DeleteAccount"
	EnableAccountCommand                   eventhorizon.CommandType = "EnableAccount"
	DisableAccountCommand                  eventhorizon.CommandType = "DisableAccount"
	UpdateAccountCommand                   eventhorizon.CommandType = "UpdateAccount"
)
View Source
const (
	AccountEnabledEvent                  eventhorizon.EventType = "AccountEnabled"
	AccountSentDisabledConfirmationEvent eventhorizon.EventType = "AccountSentDisabledConfirmation"
	AccountDeletedEvent                  eventhorizon.EventType = "AccountDeleted"
	AccountDisabledEvent                 eventhorizon.EventType = "AccountDisabled"
	AccountSentEnabledConfirmationEvent  eventhorizon.EventType = "AccountSentEnabledConfirmation"
	AccountUpdatedEvent                  eventhorizon.EventType = "AccountUpdated"
	AccountCreatedEvent                  eventhorizon.EventType = "AccountCreated"
	AccountLoggedEvent                   eventhorizon.EventType = "AccountLogged"
)
View Source
const AccountAggregateType eventhorizon.AggregateType = "Account"

Variables

This section is empty.

Functions

func AccountAggregateStateTypes

func AccountAggregateStateTypes() *accountAggregateStateTypes

func AccountCommandTypes

func AccountCommandTypes() *accountCommandTypes

func AccountEventTypes

func AccountEventTypes() *accountEventTypes

Types

type Account

type Account struct {
	Name                     *PersonName `json:"name,omitempty" eh:"optional"`
	Username                 string      `json:"username,omitempty" eh:"optional"`
	Password                 string      `json:"password,omitempty" eh:"optional"`
	Email                    string      `json:"email,omitempty" eh:"optional"`
	Roles                    []string    `json:"roles,omitempty" eh:"optional"`
	SentDisabledConfirmation bool        `json:"sentDisabledConfirmation,omitempty" eh:"optional"`
	SentEnabledConfirmation  bool        `json:"sentEnabledConfirmation,omitempty" eh:"optional"`
	Disabled                 bool        `json:"disabled,omitempty" eh:"optional"`
	Id                       uuid.UUID   `json:"id,omitempty" eh:"optional"`
	AggregateState           string      `json:"aggregateState,omitempty" eh:"optional"`
	DeletedAt                *time.Time  `json:"deletedAt,omitempty" eh:"optional"`
}

func NewAccountDefault

func NewAccountDefault() (ret *Account)

func NewAccountDefaultByPropNames

func NewAccountDefaultByPropNames(intSalt int) (ret *Account)

func NewAccountDefaultsByPropNames

func NewAccountDefaultsByPropNames(count int) []*Account

func (*Account) AddToRoles

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

func (*Account) Deleted

func (o *Account) Deleted() *time.Time

func (*Account) EntityID

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

type AccountAggregate

type AccountAggregate struct {
	*events.AggregateBase
	Account            *Account
	AggregateExecutors *AccountAggregateExecutors
	AggregateHandlers  *AccountAggregateHandlers
}

func NewAccountAggregateFull

func NewAccountAggregateFull(aggregateBase *events.AggregateBase, account *Account, aggregateExecutors *AccountAggregateExecutors,
	aggregateHandlers *AccountAggregateHandlers) (ret *AccountAggregate)

func (*AccountAggregate) ApplyEvent

func (o *AccountAggregate) ApplyEvent(ctx context.Context, event eventhorizon.Event) (err error)

func (*AccountAggregate) HandleCommand

func (o *AccountAggregate) HandleCommand(ctx context.Context, cmd eventhorizon.Command) (err error)

type AccountAggregateDeletedExecutor

type AccountAggregateDeletedExecutor struct {
	CommandsPreparer func(eventhorizon.Command, *Account) (err error)
}

func NewAccountAggregateDeletedExecutorDefault

func NewAccountAggregateDeletedExecutorDefault() (ret *AccountAggregateDeletedExecutor)

func (*AccountAggregateDeletedExecutor) AddCommandsPreparer

func (o *AccountAggregateDeletedExecutor) AddCommandsPreparer(preparer func(eventhorizon.Command, *Account) (err error))

func (*AccountAggregateDeletedExecutor) Execute

func (*AccountAggregateDeletedExecutor) SetupCommandHandler

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

func (*AccountAggregateDeletedExecutor) StateType

type AccountAggregateDeletedHandler

type AccountAggregateDeletedHandler struct {
}

func NewAccountAggregateDeletedHandlerDefault

func NewAccountAggregateDeletedHandlerDefault() (ret *AccountAggregateDeletedHandler)

func (*AccountAggregateDeletedHandler) Apply

func (*AccountAggregateDeletedHandler) SetupEventHandler

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

func (*AccountAggregateDeletedHandler) StateType

type AccountAggregateDisabledExecutor

type AccountAggregateDisabledExecutor struct {
	CommandsPreparer                func(eventhorizon.Command, *Account) (err error)
	EnableHandler                   func(*EnableAccount, *Account, eh.AggregateStoreEvent) (err error)
	SendDisabledConfirmationHandler func(*SendDisabledConfirmationAccount, *Account, eh.AggregateStoreEvent) (err error)
}

func NewAccountAggregateDisabledExecutorDefault

func NewAccountAggregateDisabledExecutorDefault() (ret *AccountAggregateDisabledExecutor)

func (*AccountAggregateDisabledExecutor) AddCommandsPreparer

func (o *AccountAggregateDisabledExecutor) AddCommandsPreparer(preparer func(eventhorizon.Command, *Account) (err error))

func (*AccountAggregateDisabledExecutor) AddEnablePreparer

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

func (*AccountAggregateDisabledExecutor) AddSendDisabledConfirmationPreparer

func (o *AccountAggregateDisabledExecutor) AddSendDisabledConfirmationPreparer(preparer func(*SendDisabledConfirmationAccount, *Account) (err error))

func (*AccountAggregateDisabledExecutor) Execute

func (*AccountAggregateDisabledExecutor) SetupCommandHandler

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

func (*AccountAggregateDisabledExecutor) StateType

type AccountAggregateDisabledHandler

type AccountAggregateDisabledHandler struct {
	EnabledHandler func(eventhorizon.Event, *Account) (err error)
}

func NewAccountAggregateDisabledHandlerDefault

func NewAccountAggregateDisabledHandlerDefault() (ret *AccountAggregateDisabledHandler)

func (*AccountAggregateDisabledHandler) Apply

func (*AccountAggregateDisabledHandler) SetupEventHandler

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

func (*AccountAggregateDisabledHandler) StateType

type AccountAggregateEnabledExecutor

type AccountAggregateEnabledExecutor struct {
	CommandsPreparer               func(eventhorizon.Command, *Account) (err error)
	DeleteHandler                  func(*DeleteAccount, *Account, eh.AggregateStoreEvent) (err error)
	DisableHandler                 func(*DisableAccount, *Account, eh.AggregateStoreEvent) (err error)
	SendEnabledConfirmationHandler func(*SendEnabledConfirmationAccount, *Account, eh.AggregateStoreEvent) (err error)
}

func NewAccountAggregateEnabledExecutorDefault

func NewAccountAggregateEnabledExecutorDefault() (ret *AccountAggregateEnabledExecutor)

func (*AccountAggregateEnabledExecutor) AddCommandsPreparer

func (o *AccountAggregateEnabledExecutor) AddCommandsPreparer(preparer func(eventhorizon.Command, *Account) (err error))

func (*AccountAggregateEnabledExecutor) AddDeletePreparer

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

func (*AccountAggregateEnabledExecutor) AddDisablePreparer

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

func (*AccountAggregateEnabledExecutor) AddSendEnabledConfirmationPreparer

func (o *AccountAggregateEnabledExecutor) AddSendEnabledConfirmationPreparer(preparer func(*SendEnabledConfirmationAccount, *Account) (err error))

func (*AccountAggregateEnabledExecutor) Execute

func (*AccountAggregateEnabledExecutor) SetupCommandHandler

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

func (*AccountAggregateEnabledExecutor) StateType

type AccountAggregateEnabledHandler

type AccountAggregateEnabledHandler struct {
	DeletedHandler  func(eventhorizon.Event, *Account) (err error)
	DisabledHandler func(eventhorizon.Event, *Account) (err error)
}

func NewAccountAggregateEnabledHandlerDefault

func NewAccountAggregateEnabledHandlerDefault() (ret *AccountAggregateEnabledHandler)

func (*AccountAggregateEnabledHandler) Apply

func (*AccountAggregateEnabledHandler) SetupEventHandler

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

func (*AccountAggregateEnabledHandler) StateType

type AccountAggregateEngine

type AccountAggregateEngine struct {
	*eh.AggregateEngine
	AggregateExecutors *AccountAggregateExecutors
	AggregateHandlers  *AccountAggregateHandlers
}

func NewAccountAggregateEngine

func NewAccountAggregateEngine(middleware *eh.Middleware) (ret *AccountAggregateEngine)

func (*AccountAggregateEngine) ActivatePasswordEncryption

func (o *AccountAggregateEngine) ActivatePasswordEncryption()

func (*AccountAggregateEngine) ImplementSendCommands

func (o *AccountAggregateEngine) ImplementSendCommands()

func (*AccountAggregateEngine) RegisterAccountProjector

func (o *AccountAggregateEngine) RegisterAccountProjector(
	projType string, listener AccountAggregateHandler, events []eventhorizon.EventType) (ret *AccountProjector, err error)

func (*AccountAggregateEngine) RegisterForCreated

func (o *AccountAggregateEngine) RegisterForCreated(handler eventhorizon.EventHandler) error

func (*AccountAggregateEngine) RegisterForDeleted

func (o *AccountAggregateEngine) RegisterForDeleted(handler eventhorizon.EventHandler) error

func (*AccountAggregateEngine) RegisterForDisabled

func (o *AccountAggregateEngine) RegisterForDisabled(handler eventhorizon.EventHandler) error

func (*AccountAggregateEngine) RegisterForEnabled

func (o *AccountAggregateEngine) RegisterForEnabled(handler eventhorizon.EventHandler) error

func (*AccountAggregateEngine) RegisterForLogged

func (o *AccountAggregateEngine) RegisterForLogged(handler eventhorizon.EventHandler) error

func (*AccountAggregateEngine) RegisterForSentDisabledConfirmation

func (o *AccountAggregateEngine) RegisterForSentDisabledConfirmation(handler eventhorizon.EventHandler) error

func (*AccountAggregateEngine) RegisterForSentEnabledConfirmation

func (o *AccountAggregateEngine) RegisterForSentEnabledConfirmation(handler eventhorizon.EventHandler) error

func (*AccountAggregateEngine) RegisterForUpdated

func (o *AccountAggregateEngine) RegisterForUpdated(handler eventhorizon.EventHandler) error

func (*AccountAggregateEngine) Setup

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

type AccountAggregateExecutor

type AccountAggregateExecutor interface {
	Execute(cmd eventhorizon.Command, account *Account, store eh.AggregateStoreEvent) (err error)
}

type AccountAggregateExecutors

type AccountAggregateExecutors struct {
	Initial          *AccountAggregateInitialExecutor
	Deleted          *AccountAggregateDeletedExecutor
	Disabled         *AccountAggregateDisabledExecutor
	Enabled          *AccountAggregateEnabledExecutor
	Exist            *AccountAggregateExistExecutor
	CommandsPreparer func(eventhorizon.Command, *Account) (err error)
}

func NewAccountAggregateExecutorsFull

func NewAccountAggregateExecutorsFull() (ret *AccountAggregateExecutors)

func (*AccountAggregateExecutors) AddCommandsPreparer

func (o *AccountAggregateExecutors) AddCommandsPreparer(preparer func(eventhorizon.Command, *Account) (err error))

func (*AccountAggregateExecutors) Execute

func (o *AccountAggregateExecutors) Execute(cmd eventhorizon.Command, account *Account, store eh.AggregateStoreEvent) (err error)

func (*AccountAggregateExecutors) SetupCommandHandler

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

type AccountAggregateExistExecutor

type AccountAggregateExistExecutor struct {
	CommandsPreparer func(eventhorizon.Command, *Account) (err error)
	DeleteHandler    func(*DeleteAccount, *Account, eh.AggregateStoreEvent) (err error)
	UpdateHandler    func(*UpdateAccount, *Account, eh.AggregateStoreEvent) (err error)
}

func NewAccountAggregateExistExecutorDefault

func NewAccountAggregateExistExecutorDefault() (ret *AccountAggregateExistExecutor)

func (*AccountAggregateExistExecutor) AddCommandsPreparer

func (o *AccountAggregateExistExecutor) AddCommandsPreparer(preparer func(eventhorizon.Command, *Account) (err error))

func (*AccountAggregateExistExecutor) AddDeletePreparer

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

func (*AccountAggregateExistExecutor) AddUpdatePreparer

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

func (*AccountAggregateExistExecutor) Execute

func (o *AccountAggregateExistExecutor) Execute(cmd eventhorizon.Command, account *Account, store eh.AggregateStoreEvent) (err error)

func (*AccountAggregateExistExecutor) SetupCommandHandler

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

func (*AccountAggregateExistExecutor) StateType

type AccountAggregateExistHandler

type AccountAggregateExistHandler struct {
	DeletedHandler func(eventhorizon.Event, *Account) (err error)
	UpdatedHandler func(eventhorizon.Event, *AccountUpdated, *Account) (err error)
}

func NewAccountAggregateExistHandlerDefault

func NewAccountAggregateExistHandlerDefault() (ret *AccountAggregateExistHandler)

func (*AccountAggregateExistHandler) Apply

func (*AccountAggregateExistHandler) SetupEventHandler

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

func (*AccountAggregateExistHandler) StateType

type AccountAggregateHandler

type AccountAggregateHandler interface {
	Apply(event eventhorizon.Event, account *Account) (err error)
}

type AccountAggregateHandlers

type AccountAggregateHandlers struct {
	Initial        *AccountAggregateInitialHandler
	Deleted        *AccountAggregateDeletedHandler
	Disabled       *AccountAggregateDisabledHandler
	Enabled        *AccountAggregateEnabledHandler
	Exist          *AccountAggregateExistHandler
	EventsPreparer func(eventhorizon.Event, *Account) (err error)
}

func NewAccountAggregateHandlersFull

func NewAccountAggregateHandlersFull() (ret *AccountAggregateHandlers)

func (*AccountAggregateHandlers) AddEventsPreparer

func (o *AccountAggregateHandlers) AddEventsPreparer(preparer func(eventhorizon.Event, *Account) (err error))

func (*AccountAggregateHandlers) Apply

func (o *AccountAggregateHandlers) Apply(event eventhorizon.Event, account *Account) (err error)

func (*AccountAggregateHandlers) SetupEventHandler

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

type AccountAggregateInitialExecutor

type AccountAggregateInitialExecutor struct {
	CommandsPreparer func(eventhorizon.Command, *Account) (err error)
	CreateHandler    func(*CreateAccount, *Account, eh.AggregateStoreEvent) (err error)
}

func NewAccountAggregateInitialExecutorDefault

func NewAccountAggregateInitialExecutorDefault() (ret *AccountAggregateInitialExecutor)

func (*AccountAggregateInitialExecutor) AddCommandsPreparer

func (o *AccountAggregateInitialExecutor) AddCommandsPreparer(preparer func(eventhorizon.Command, *Account) (err error))

func (*AccountAggregateInitialExecutor) AddCreatePreparer

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

func (*AccountAggregateInitialExecutor) Execute

func (*AccountAggregateInitialExecutor) SetupCommandHandler

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

func (*AccountAggregateInitialExecutor) StateType

type AccountAggregateInitialHandler

type AccountAggregateInitialHandler struct {
	CreatedHandler func(eventhorizon.Event, *AccountCreated, *Account) (err error)
}

func NewAccountAggregateInitialHandlerDefault

func NewAccountAggregateInitialHandlerDefault() (ret *AccountAggregateInitialHandler)

func (*AccountAggregateInitialHandler) Apply

func (*AccountAggregateInitialHandler) SetupEventHandler

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

func (*AccountAggregateInitialHandler) StateType

type AccountAggregateStateType

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

func (*AccountAggregateStateType) GetBSON

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

func (*AccountAggregateStateType) IsDeleted

func (o *AccountAggregateStateType) IsDeleted() bool

func (*AccountAggregateStateType) IsDisabled

func (o *AccountAggregateStateType) IsDisabled() bool

func (*AccountAggregateStateType) IsEnabled

func (o *AccountAggregateStateType) IsEnabled() bool

func (*AccountAggregateStateType) IsExist

func (o *AccountAggregateStateType) IsExist() bool

func (*AccountAggregateStateType) IsInitial

func (o *AccountAggregateStateType) IsInitial() bool

func (*AccountAggregateStateType) MarshalJSON

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

func (*AccountAggregateStateType) Name

func (*AccountAggregateStateType) Ordinal

func (o *AccountAggregateStateType) Ordinal() int

func (*AccountAggregateStateType) SetBSON

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

func (*AccountAggregateStateType) UnmarshalJSON

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

type AccountCli

type AccountCli struct {
	Client *AccountClient
}

func NewAccountCli

func NewAccountCli(client *AccountClient) (ret *AccountCli)

func (*AccountCli) BuildCommandDeleteById

func (o *AccountCli) BuildCommandDeleteById() (ret cli.Command)

func (*AccountCli) BuildCommandDeleteByIds

func (o *AccountCli) BuildCommandDeleteByIds() (ret cli.Command)

func (*AccountCli) BuildCommandExportJSON

func (o *AccountCli) BuildCommandExportJSON() (ret cli.Command)

func (*AccountCli) BuildCommandImportJSON

func (o *AccountCli) BuildCommandImportJSON() (ret cli.Command)

func (*AccountCli) BuildCommands

func (o *AccountCli) BuildCommands() (ret []cli.Command)

type AccountClient

type AccountClient struct {
	UrlIdBased string
	Url        string
	Client     *http.Client
}

func NewAccountClient

func NewAccountClient(url string, client *http.Client) (ret *AccountClient)

func (*AccountClient) Create

func (o *AccountClient) Create(item *Account) (err error)

func (*AccountClient) CreateItems

func (o *AccountClient) CreateItems(items []*Account) (err error)

func (*AccountClient) DeleteById

func (o *AccountClient) DeleteById(itemId *uuid.UUID) (err error)

func (*AccountClient) DeleteByIds

func (o *AccountClient) DeleteByIds(itemIds []uuid.UUID) (err error)

func (*AccountClient) ExportJSON

func (o *AccountClient) ExportJSON(targetFileJSON string) (err error)

func (*AccountClient) FindAll

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

func (*AccountClient) ImportJSON

func (o *AccountClient) ImportJSON(fileJSON string) (err error)

func (*AccountClient) ReadFileJSON

func (o *AccountClient) ReadFileJSON(fileJSON string) (ret []*Account, 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) IsSendDisabledConfirmationAccount

func (o *AccountCommandType) IsSendDisabledConfirmationAccount() bool

func (*AccountCommandType) IsSendEnabledConfirmationAccount

func (o *AccountCommandType) IsSendEnabledConfirmationAccount() 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 AccountCreated

type AccountCreated struct {
	Name     *PersonName `json:"name,omitempty" eh:"optional"`
	Username string      `json:"username,omitempty" eh:"optional"`
	Password string      `json:"password,omitempty" eh:"optional"`
	Email    string      `json:"email,omitempty" eh:"optional"`
	Roles    []string    `json:"roles,omitempty" eh:"optional"`
}

func (*AccountCreated) AddToRoles

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

type AccountDisabled

type AccountDisabled struct {
}

type AccountEnabled

type AccountEnabled struct {
}

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) IsAccountSentDisabledConfirmation

func (o *AccountEventType) IsAccountSentDisabledConfirmation() bool

func (*AccountEventType) IsAccountSentEnabledConfirmation

func (o *AccountEventType) IsAccountSentEnabledConfirmation() bool

func (*AccountEventType) IsAccountUpdated

func (o *AccountEventType) IsAccountUpdated() 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 AccountHandler

type AccountHandler struct {
}

func NewAccountHandlerDefault

func NewAccountHandlerDefault() (ret *AccountHandler)

type AccountHttpCommandHandler

type AccountHttpCommandHandler struct {
	*eh.HttpCommandHandler
}

func NewAccountHttpCommandHandlerFull

func NewAccountHttpCommandHandlerFull(httpCommandHandler *eh.HttpCommandHandler) (ret *AccountHttpCommandHandler)

func (*AccountHttpCommandHandler) Create

func (*AccountHttpCommandHandler) Delete

func (*AccountHttpCommandHandler) Disable

func (*AccountHttpCommandHandler) Enable

func (*AccountHttpCommandHandler) Login

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
}

func NewAccountHttpQueryHandlerFull

func NewAccountHttpQueryHandlerFull(httpQueryHandler *eh.HttpQueryHandler, queryRepository *AccountQueryRepository) (ret *AccountHttpQueryHandler)

func (*AccountHttpQueryHandler) CountAll

func (*AccountHttpQueryHandler) CountById

func (*AccountHttpQueryHandler) ExistAll

func (*AccountHttpQueryHandler) ExistById

func (*AccountHttpQueryHandler) FindAll

func (*AccountHttpQueryHandler) FindById

type AccountLogged

type AccountLogged struct {
	Username string `json:"username,omitempty" eh:"optional"`
	Email    string `json:"email,omitempty" eh:"optional"`
	Password string `json:"password,omitempty" eh:"optional"`
}

type AccountProjector

type AccountProjector struct {
	AccountAggregateHandler

	Repo eventhorizon.ReadRepo
	// contains filtered or unexported fields
}

func NewAccountProjector

func NewAccountProjector(projType string, eventHandler AccountAggregateHandler, repo eventhorizon.ReadRepo) (ret *AccountProjector)

func (*AccountProjector) Project

func (o *AccountProjector) Project(
	ctx context.Context, event eventhorizon.Event, entity eventhorizon.Entity) (ret eventhorizon.Entity, err error)

func (*AccountProjector) ProjectorType

func (o *AccountProjector) ProjectorType() projector.Type

type AccountQueryRepository

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

func NewAccountQueryRepositoryFull

func NewAccountQueryRepositoryFull(repo eventhorizon.ReadRepo, ctx 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
	PathPrefixIdBased string
	QueryHandler      *AccountHttpQueryHandler
	CommandHandler    *AccountHttpCommandHandler
}

func NewAccountRouter

func NewAccountRouter(pathPrefix string, newContext func(string) (ret context.Context), commandBus *bus.CommandHandler,
	repo eventhorizon.ReadRepo) (ret *AccountRouter)

func (*AccountRouter) Setup

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

type AccountUpdated

type AccountUpdated struct {
	Name     *PersonName `json:"name,omitempty" eh:"optional"`
	Username string      `json:"username,omitempty" eh:"optional"`
	Password string      `json:"password,omitempty" eh:"optional"`
	Email    string      `json:"email,omitempty" eh:"optional"`
	Roles    []string    `json:"roles,omitempty" eh:"optional"`
}

func (*AccountUpdated) AddToRoles

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

type Cli

type Cli struct {
	Client     *Client
	AccountCli *AccountCli
}

func NewCli

func NewCli(url string, httpClient *http.Client) (ret *Cli)

type Client

type Client struct {
	Url           string
	Client        *http.Client
	AccountClient *AccountClient
}

func NewClient

func NewClient(url string, client *http.Client) (ret *Client)

type CreateAccount

type CreateAccount struct {
	Name     *PersonName `json:"name,omitempty" eh:"optional"`
	Username string      `json:"username,omitempty" eh:"optional"`
	Password string      `json:"password,omitempty" eh:"optional"`
	Email    string      `json:"email,omitempty" eh:"optional"`
	Roles    []string    `json:"roles,omitempty" eh:"optional"`
	Id       uuid.UUID   `json:"id,omitempty" 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,omitempty" 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 Deleted

type Deleted struct {
}

func NewDeletedDefault

func NewDeletedDefault() (ret *Deleted)

type DisableAccount

type DisableAccount struct {
	Id uuid.UUID `json:"id,omitempty" 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 Disabled

type Disabled struct {
	*Exist
}

func NewDisabledDefault

func NewDisabledDefault() (ret *Disabled)

type EnableAccount

type EnableAccount struct {
	Id uuid.UUID `json:"id,omitempty" 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 Enabled

type Enabled struct {
	*Exist
}

func NewEnabledDefault

func NewEnabledDefault() (ret *Enabled)

type EsEngine

type EsEngine struct {
	*eh.Middleware
	Account *AccountAggregateEngine
}

func NewEsEngine

func NewEsEngine(middleware *eh.Middleware) (ret *EsEngine)

func (*EsEngine) ActivatePasswordEncryption

func (o *EsEngine) ActivatePasswordEncryption()

func (*EsEngine) Setup

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

type Exist

type Exist struct {
}

func NewExistDefault

func NewExistDefault() (ret *Exist)

func NewExistFull

func NewExistFull() (ret *Exist)

type Initial

type Initial struct {
}

func NewInitialDefault

func NewInitialDefault() (ret *Initial)

type LoginAccount

type LoginAccount struct {
	Username string    `json:"username,omitempty" eh:"optional"`
	Email    string    `json:"email,omitempty" eh:"optional"`
	Password string    `json:"password,omitempty" eh:"optional"`
	Id       uuid.UUID `json:"id,omitempty" 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,omitempty" eh:"optional"`
	Last  string `json:"last,omitempty" eh:"optional"`
}

func NewPersonNameDefault

func NewPersonNameDefault() (ret *PersonName)

func NewPersonNameDefaultByPropNames

func NewPersonNameDefaultByPropNames(intSalt int) (ret *PersonName)

func NewPersonNameDefaultsByPropNames

func NewPersonNameDefaultsByPropNames(count int) []*PersonName

type Router

type Router struct {
	PathPrefix    string
	AccountRouter *AccountRouter
}

func NewRouter

func NewRouter(pathPrefix string, newContext func(string) (ret context.Context), esEngine *EsEngine) (ret *Router, err error)

func (*Router) Setup

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

type SendDisabledConfirmationAccount

type SendDisabledConfirmationAccount struct {
	Id uuid.UUID `json:"id,omitempty" eh:"optional"`
}

func (*SendDisabledConfirmationAccount) AggregateID

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

func (*SendDisabledConfirmationAccount) AggregateType

func (*SendDisabledConfirmationAccount) CommandType

type SendEnabledConfirmationAccount

type SendEnabledConfirmationAccount struct {
	Id uuid.UUID `json:"id,omitempty" eh:"optional"`
}

func (*SendEnabledConfirmationAccount) AggregateID

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

func (*SendEnabledConfirmationAccount) AggregateType

func (*SendEnabledConfirmationAccount) CommandType

type UpdateAccount

type UpdateAccount struct {
	Name     *PersonName `json:"name,omitempty" eh:"optional"`
	Username string      `json:"username,omitempty" eh:"optional"`
	Password string      `json:"password,omitempty" eh:"optional"`
	Email    string      `json:"email,omitempty" eh:"optional"`
	Roles    []string    `json:"roles,omitempty" eh:"optional"`
	Id       uuid.UUID   `json:"id,omitempty" 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,omitempty" eh:"optional"`
	Password string `json:"password,omitempty" eh:"optional"`
}

func NewUserCredentialsDefault

func NewUserCredentialsDefault() (ret *UserCredentials)

func NewUserCredentialsDefaultByPropNames

func NewUserCredentialsDefaultByPropNames(intSalt int) (ret *UserCredentials)

func NewUserCredentialsDefaultsByPropNames

func NewUserCredentialsDefaultsByPropNames(count int) []*UserCredentials

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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