Documentation
¶
Index ¶
Constants ¶
View Source
const ( PortalTypeBlue = "blue" PortalTypeYellow = "yellow" )
View Source
const ( MarkedMapColorNone = "none" MarkedMapColorGreen = "green" MarkedMapColorPink = "pink" MarkedMapColorPurple = "purple" MarkedMapColorOrange = "orange" MarkedMapColorBrown = "brown" )
View Source
const ( PlantUMLStyleAuto = "auto" // if len(edges)<32 use plantuml else use dot PlantUMLStylePlantUML = "plantuml" PlantUMLStyleDOT = "dot" )
View Source
const ( DefaultKrokiEndpoint = "https://kroki.io" DefaultKrokiTimeout = 60 * time.Second // kroki.io is so slow :( )
View Source
const ( // The value must be a JSON-encoded list of MarkedMap. NavigationDataMarkedMaps = "marked" )
View Source
const (
PortalDataKeyUser = "user"
)
Variables ¶
This section is empty.
Functions ¶
func BriefNavigation ¶
func BriefNavigation(n *Navigation, mapData map[string]data.MapData) string
Types ¶
type KrokiPlantUMLPNGPainter ¶
type KrokiPlantUMLPNGPainter struct { Client kroki.Client MapData map[string]data.MapData Style string }
func NewKrokiPlantUMLPNGPainter ¶ added in v1.5.0
func (*KrokiPlantUMLPNGPainter) NavigationToTemplateData ¶
func (p *KrokiPlantUMLPNGPainter) NavigationToTemplateData(n *Navigation, t time.Time) (templateData, error)
func (*KrokiPlantUMLPNGPainter) Paint ¶
func (p *KrokiPlantUMLPNGPainter) Paint(n *Navigation) (path string, err error)
func (*KrokiPlantUMLPNGPainter) ToPlantUML ¶
func (p *KrokiPlantUMLPNGPainter) ToPlantUML(n *Navigation) (string, error)
type MarkedMap ¶ added in v1.6.0
type MarkedMap struct { ID string `json:"id"` Color string `json:"color"` Comment string `json:"comment"` // User who added the entry. Currently only used for display. // NOTE: consider using `Data map[string]string` instead, for code consistency. User string `json:"user"` }
MarkedMap holds the data of a marked map.
type Navigation ¶
type Navigation struct { string `json:"name"` Portals []*Portal `json:"portals"` Data map[string]string `json:"data"` }Name
func NewNavigation ¶
func NewNavigation(name string) *Navigation
NewNavigation initializes a Navigation.
func (*Navigation) AddPortal ¶
func (n *Navigation) AddPortal(p *Portal)
AddPortal adds a portal to the navigation.
func (*Navigation) DeepCopy ¶ added in v1.7.0
func (n *Navigation) DeepCopy() *Navigation
func (*Navigation) DeepCopyInto ¶ added in v1.7.0
func (n *Navigation) DeepCopyInto(out *Navigation)
func (*Navigation) DeleteExpiredPortals ¶
func (n *Navigation) DeleteExpiredPortals()
DeleteExpiredPortals deletes expired portals.
type Painter ¶
type Painter interface {
Paint(n *Navigation) (path string, err error)
}
type Portal ¶
type Portal struct { // From is the map with a smaller name. Note that Route is an undirected path. From string `json:"from"` // To is the map with a larger name. Note that Route is an undirected path. To string `json:"to"` // Type is the portal type. Type string `json:"type"` ExpiredAt time.Time `json:"expired_at"` // Data contains additional data. // E.g. the user who added the portal. Data map[string]string `json:"data"` }
func NewPortal ¶
NewPortal initializes a Portal. map1 and map2 are sorted in alphabetical order, then the smaller one is set to Portal.From and the other is set to Portal.To.
func (*Portal) DeepCopyInto ¶ added in v1.7.0
Click to show internal directories.
Click to hide internal directories.