Skip to content

P-A-R-U-S/Go-CQRS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CQRS Pattern for Go language License Go Report Card Travis-CI

Getting Started

Project distributed as open-source example and you can can copy and modify code snippet based on you need or requirements. Project contains following parts:

Create handler(s)

const ExampleEvent = "_EventExample"

type ExampleHandler1 struct {
}

func (h *ExampleHandler1) Event() string {

	return ExampleEvent
}
func (h *ExampleHandler1) Execute(... interface{}) error {

	fmt.Println("Run Execute...")

	return nil
}
func (h *ExampleHandler1) OnSubscribe() {
	fmt.Println("Run OnSubscribe...")
}
func (h *ExampleHandler1) OnUnsubscribe() {
	fmt.Println("Run OnUnsubscribe...")
}

Add handler into the Bus and send message

func main()  {

	eventBus := bus.New()

	h := &ExampleHandler1{}

	eventBus.Subscribe(h)

	eventBus.Publish(ExampleEvent, 1, 2, "Test Message", 4.5)

	defer eventBus.Unsubscribe(ExampleEvent)
}

Contributing

The project intended to use as a part of part of the project, but if you want to contribute, feel free to send pull requests!

Have problems, bugs, feature ideas? We are using the github issue tracker to manage them.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Valentyn Ponomarenko - Initial work - P-A-R-U-S

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Hat tip to anyone who's code was used
  • Inspiration
  • etc

About

CQRS Implementation for Golang language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages