diff --git a/route_end.go b/route_end.go index 0ee5e95..a43be65 100644 --- a/route_end.go +++ b/route_end.go @@ -2,19 +2,24 @@ package feragstring import "fmt" +// RouteEnd is the struct that automatically ends a route definition type RouteEnd struct { FeragMessage routeName string } +// RouteName returns the formatted route name segment func (re *RouteEnd) RouteName() string { return fmt.Sprintf("+11%-13s", re.routeName) } +// SetRouteName sets the route name field func (re *RouteEnd) SetRouteName(routeName string) { re.routeName = routeName } +// NewRouteEnd instantiates a new Route End +// struct and returns a pointer to it. func NewRouteEnd() *RouteEnd { re := RouteEnd{ FeragMessage: FeragMessage{ @@ -25,11 +30,15 @@ func NewRouteEnd() *RouteEnd { return &re } +// Payload returns the formatted FERAG string +// for embedding in the message func (re *RouteEnd) Payload() string { data := re.RouteName() return data } +// Message returns the formatted FERAG string +// for the complete route end message func (re *RouteEnd) Message() string { message := re.FeragMessage.MessageTemplate() return message(&re.FeragMessage, re.Payload())