route/database/route.go

24 lines
484 B
Go
Raw Normal View History

package database
import (
2017-04-29 01:09:14 +00:00
proto "git.xeserv.us/xena/route/proto"
)
// Route is a single HTTP route.
type Route struct {
ID string `gorethink:"id,omitempty" storm:"id"`
Creator string
Hostname string `gorethink:"hostname" storm:"index"`
Token string `gorethink:"token" storm:"-"` // deprecated
}
2017-04-29 01:09:14 +00:00
// AsProto converts this into the protobuf.
func (r Route) AsProto() *proto.Route {
return &proto.Route{
Id: r.ID,
Creator: r.Creator,
Host: r.Hostname,
}
}