domain

package
v0.0.0-...-c31d802 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SomeIdentityMinLength = 1
	SomeIdentityMaxLength = 64
	SomeIdentityPattern   = "[0-9A-Za-z-_]+"
)

Variables

Functions

This section is empty.

Types

type Entity

type Entity interface {
	SameIdentityAs(other Entity) bool
}

Entity DDDにおけるエンティティの概念

type Event

type Event interface {
	OccurredOn() time.Time
	SameEventAs(other Event) bool
}

Event DDDにおけるドメインイベントの概念

type EventPublisher

type EventPublisher interface {
	Publish(event Event)
}

EventPublisher Event の出版インターフェース

type EventSubscriber

type EventSubscriber interface {
	Handle(event Event)
}

EventSubscriber Event の購読インターフェース

type Identity

type Identity interface {
	ValueObject
}

Identity 何らかのドメインを識別するIDを表現した値オブジェクトの概念インターフェース

type SomeIdentity

type SomeIdentity struct {
	Identity
	// contains filtered or unexported fields
}

SomeIdentity 何らかのドメインを識別するIDを表現した値オブジェクト

func NewSomeIdentity

func NewSomeIdentity(id string) *SomeIdentity

func (*SomeIdentity) ID

func (si *SomeIdentity) ID() string

func (*SomeIdentity) String

func (si *SomeIdentity) String() string

type SomeValueObject

type SomeValueObject[V comparable] struct {
	ValueObject
	// contains filtered or unexported fields
}

SomeValueObject 何らかの型の値を1つ持つ値オブジェクト

func NewSomeValueObject

func NewSomeValueObject[V comparable](value V) *SomeValueObject[V]

func (*SomeValueObject[V]) String

func (svo *SomeValueObject[V]) String() string

func (*SomeValueObject[V]) Value

func (svo *SomeValueObject[V]) Value() V

type ValueObject

type ValueObject interface {
	SameValueAs(other ValueObject) bool
}

ValueObject DDDにおける値オブジェクトの概念インターフェース

Jump to

Keyboard shortcuts

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