24 lines
499 B
Go
24 lines
499 B
Go
|
package domain
|
||
|
|
||
|
import "source.toby3d.me/toby3d/home/internal/common"
|
||
|
|
||
|
type Direction struct{ direction string }
|
||
|
|
||
|
var (
|
||
|
DirectionUnd Direction = Direction{} // "und"
|
||
|
DirectionLeftToRight Direction = Direction{"ltr"} // "ltr"
|
||
|
DirectionRightToLeft Direction = Direction{"rtl"} // "rtl"
|
||
|
)
|
||
|
|
||
|
func (d Direction) String() string {
|
||
|
if d.direction == "" {
|
||
|
return common.Und
|
||
|
}
|
||
|
|
||
|
return d.direction
|
||
|
}
|
||
|
|
||
|
func (d Direction) GoString() string {
|
||
|
return "domain.Direction(" + d.String() + ")"
|
||
|
}
|