Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dhamidi/ess
/ functions
Functions
196 in github.com/dhamidi/ess
⨍
Functions
196
◇
Types & classes
44
↓ 37 callers
Method
T
(name string, attributes HTMLAttributes, children ...*HTML)
examples/blog/html.go:64
↓ 34 callers
Method
Add
Add sets the payload for the field name to value.
event.go:46
↓ 29 callers
Method
String
String should convert the value to a string representing this value's data.
interfaces.go:45
↓ 24 callers
Method
Get
Get returns the field identified by name or nil if the field does not exist.
command.go:192
↓ 20 callers
Method
A
(name, value string)
examples/blog/html.go:85
↓ 19 callers
Method
Add
Add records an error for field using desc as the error description.
validation_error.go:28
↓ 19 callers
Method
Field
Field defines a field with the given name and type. Use this method to define the different parameters of a command.
command.go:105
↓ 19 callers
Method
For
For marks the event as being emitted by source.
event.go:40
↓ 19 callers
Method
Set
Set sets the value for the field identified by name. Setting a value using this method parses the string given in value according to the field's type
command.go:211
↓ 18 callers
Function
NewEvent
NewEvent creates a new, empty event of type name.
event.go:32
↓ 17 callers
Method
Error
Error returns any error encountered or caused by processing the command. If nil is returned, it is safe to assume that the application processed the
command.go:18
↓ 17 callers
Method
Id
Id returns a string uniquely identifying the aggregate. The aggregate's id is used for routing commands to it and associating emitted events with this
interfaces.go:19
↓ 17 callers
Method
Text
(text string)
examples/blog/html.go:77
↓ 12 callers
Method
Send
Send sends command to the application for processing. Send is not thread safe.
application.go:96
↓ 12 callers
Function
newTestAggregate
(id string)
test_aggregate.go:19
↓ 11 callers
Method
WriteHTML
(w io.Writer, prefix, indent string)
examples/blog/html.go:28
↓ 10 callers
Function
NewHTMLDocument
(title string, body ...*HTML)
examples/blog/html.go:96
↓ 10 callers
Method
Return
Return returns nil if no errors have been recorded with this instance. Otherwise this instance is returned. This method exists to avoid returning a
validation_error.go:67
↓ 9 callers
Method
Ok
Ok returns true if no errors have been recorded with this instance.
validation_error.go:25
↓ 9 callers
Method
PublishEvent
PublishEvent queues event for publishing.
interfaces.go:56
↓ 9 callers
Method
ToHTML
(submit string)
examples/blog/templates.go:141
↓ 8 callers
Method
C
(children ...*HTML)
examples/blog/html.go:72
↓ 8 callers
Method
NewCommand
NewCommand constructs a new instance of a command, according to this command definition.
command.go:129
↓ 7 callers
Method
FromForm
FromForm sets all of the command's fields with the values found in form.
command.go:225
↓ 7 callers
Function
NewTestApp
()
application_test.go:44
↓ 7 callers
Function
NewValidationError
NewValidationError returns a new, empty validation error.
validation_error.go:18
↓ 7 callers
Method
Now
()
interfaces.go:34
↓ 7 callers
Method
Target
Target sets the function to create a new receiver of the right type for this command to constructor. The constructor's task is to return an aggregate
command.go:122
↓ 5 callers
Method
AggregateId
AggregateId returns the id of the command's receiver, according to the command's IdField. If the field is not present, it returns the empty string.
command.go:176
↓ 5 callers
Method
Fill
(params *ess.Command, err error)
examples/blog/templates.go:119
↓ 5 callers
Function
Form
(name, action string, fields ...*HTMLFormField)
examples/blog/templates.go:82
↓ 5 callers
Function
NewEventsInMemory
NewEventsInMemory creates a new instance of this event store holding no events initially.
events_in_memory.go:10
↓ 5 callers
Method
Param
(name, value string)
examples/blog/templates.go:114
↓ 5 callers
Method
WithProjection
WithProjection registers projection with name at the application.
application.go:75
↓ 4 callers
Function
MethodNotSupported
(w http.ResponseWriter)
examples/blog/main.go:168
↓ 4 callers
Method
Replay
Replay replays the events belonging to the stream identified by streamId using receiver. Using "*" as the streamId select all events, regardless of t
interfaces.go:95
↓ 4 callers
Method
Store
Store append events to the store in a manner that allows them to be retrieved by Replay. The returned error is implementation defined.
interfaces.go:86
↓ 4 callers
Function
loadCurrentUser
(req *http.Request, sessions SessionStore)
examples/blog/main.go:291
↓ 3 callers
Method
ById
(id string)
examples/blog/main.go:288
↓ 3 callers
Method
FormValue
FromValue returns the string value associated with the form field "field".
interfaces.go:106
↓ 3 callers
Method
HandleEvent
(event *Event)
interfaces.go:70
↓ 3 callers
Function
NewErrorResult
NewErrorResult wraps err in a CommandResult.
command.go:28
↓ 3 callers
Method
UnmarshalText
(data []byte)
values.go:126
↓ 3 callers
Method
WithStore
WithStore sets the application's event store to store. Do not call this method after Init has been called.
application.go:69
↓ 2 callers
Method
Action
(action string)
examples/blog/templates.go:109
↓ 2 callers
Method
Copy
Copy creates a new instance with the same internal state as this value instance.
interfaces.go:49
↓ 2 callers
Method
Events
Events returns all events stored by this instance.
events_in_memory.go:47
↓ 2 callers
Method
Init
Init reconstructs application state from history. Call this method once initially after configuring your application.
application.go:90
↓ 2 callers
Method
Merge
Merge records errors from err into this instance. If err is a ValidationError, all recorded errors for all fields from err are merged into this insta
validation_error.go:40
↓ 2 callers
Function
NewEventStoreTest
NewEventStoreTest returns a new test suite using setup as the test setup function. TearDown is set to do nothing.
event_store_test_suite.go:23
↓ 2 callers
Function
NewUser
(username string)
examples/signup/main.go:28
↓ 2 callers
Function
NotFound
(w http.ResponseWriter)
examples/blog/main.go:172
↓ 2 callers
Method
Occur
Occur marks the occurrence time of the event according to clock.
event.go:52
↓ 2 callers
Method
Persist
Persist marks the time of persisting the event according to clock.
event.go:58
↓ 2 callers
Function
RequireLogin
(w http.ResponseWriter, req *http.Request)
examples/blog/main.go:176
↓ 2 callers
Method
Run
Run runs all tests.
event_store_test_suite.go:31
↓ 2 callers
Method
SignUp
(name, email, password string)
examples/signup/main.go:56
↓ 2 callers
Method
Update
(event *ess.Event)
examples/blog/all_posts.go:35
↓ 2 callers
Method
WithLogger
WithLogger sets the application's logger to logger.
application.go:62
↓ 2 callers
Function
args
(argv ...string)
examples/blog/main.go:333
↓ 2 callers
Method
err
err adds an error to the list of errors for field
command.go:186
↓ 1 callers
Method
Acknowledge
Acknowledge marks the command as having been received by the system. Calling Acknowledge on a command sets the field "now" to the time provided by cl
command.go:244
↓ 1 callers
Method
Copy
()
examples/blog/templates.go:98
↓ 1 callers
Method
Edit
(title, body, reason, username string)
examples/blog/post.go:52
↓ 1 callers
Method
Error
Error implements the error interface.
validation_error.go:76
↓ 1 callers
Method
Execute
Execute passes this command to its receiver, merging any errors returned into the errors encountered during parameter processing.
command.go:251
↓ 1 callers
Method
FailWith
(err error)
test_aggregate.go:23
↓ 1 callers
Function
GenerateSessionId
()
examples/blog/sessions.go:10
↓ 1 callers
Method
HandleCommand
HandleCommand tries to process command. If command cannot be processed due to a validation of business rules, a *ValidationError should be returned.
interfaces.go:65
↓ 1 callers
Method
HandleEvent
(event *ess.Event)
examples/signup/main.go:84
↓ 1 callers
Function
HandleSignup
(app *ess.Application)
examples/signup/main.go:128
↓ 1 callers
Method
HasActiveSession
(session string)
examples/blog/user.go:101
↓ 1 callers
Function
Id
Id returns a new empty identifier.
values.go:95
↓ 1 callers
Function
InputField
(label, kind, name, value string, errors []string)
examples/blog/templates.go:42
↓ 1 callers
Method
Lit
(text string)
examples/blog/html.go:81
↓ 1 callers
Method
Login
(session string, password *ess.BcryptedPassword)
examples/blog/user.go:53
↓ 1 callers
Method
Login
(w http.ResponseWriter, req *http.Request)
examples/blog/main.go:116
↓ 1 callers
Method
Logout
(session string)
examples/blog/user.go:75
↓ 1 callers
Method
Logout
(w http.ResponseWriter, req *http.Request)
examples/blog/main.go:105
↓ 1 callers
Method
Matches
Matches returns true if this password matches hashedPassword.
values.go:183
↓ 1 callers
Function
NewAllPostsInMemory
()
examples/blog/all_posts.go:62
↓ 1 callers
Function
NewAllSessionsInMemory
()
examples/blog/sessions.go:28
↓ 1 callers
Function
NewApplication
NewApplication creates a new application instance with reasonable default settings. Events are stored in memory only and informational messages are l
application.go:51
↓ 1 callers
Function
NewCommandDefinition
NewCommandDefinition creates a new command definition using name as the name for the command.
command.go:86
↓ 1 callers
Function
NewEventsOnDisk
NewEventsOnDisk returns an new instance appending events to file and using clock for marking events as persisted.
events_on_disk.go:23
↓ 1 callers
Function
NewLineWriter
(lines *[]string)
application_test.go:24
↓ 1 callers
Function
NewPost
(id string)
examples/blog/post.go:12
↓ 1 callers
Function
NewProjectedPostFromEvent
(event *ess.Event)
examples/blog/all_posts.go:29
↓ 1 callers
Function
NewSuccessResult
NewSuccessResult returns a CommandResult that marks a success for receiver.
command.go:36
↓ 1 callers
Function
NewUser
(id string)
examples/blog/user.go:14
↓ 1 callers
Function
PostOnIndex
(post *ProjectedPost, currentUser *ProjectedUser)
examples/blog/templates.go:242
↓ 1 callers
Method
Project
Project passes event to all of the application's projections.
application.go:81
↓ 1 callers
Method
PublishWith
PublishWith configures the aggregate to emit events using publisher.
interfaces.go:23
↓ 1 callers
Method
Receiver
Receiver returns an instance of the command's receiver, possibly creating the instance.
command.go:198
↓ 1 callers
Method
Recent
()
examples/blog/all_posts.go:88
↓ 1 callers
Function
ShowAllPostsIndex
(w http.ResponseWriter, currentUser *ProjectedUser, posts []*ProjectedPost)
examples/blog/templates.go:270
↓ 1 callers
Function
ShowEditPostForm
(w http.ResponseWriter, params *ess.Command)
examples/blog/templates.go:316
↓ 1 callers
Function
ShowEditPostFormError
(w http.ResponseWriter, params *ess.Command, err error)
examples/blog/templates.go:329
↓ 1 callers
Function
ShowLoginForm
(w http.ResponseWriter, req *http.Request)
examples/blog/templates.go:227
↓ 1 callers
Function
ShowLoginFormError
(w http.ResponseWriter, params *ess.Command, err error)
examples/blog/templates.go:234
next →
1–100 of 196, ranked by callers