plantuml

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: MIT Imports: 4 Imported by: 0

README

plantuml

PlantUML encoder&decoder in go

import

import (
    "github.com/trislu/plantuml"
)

Encode() example

const text = `@startuml
Eve -> Bob : hello
@enduml`
var encoded string = plantuml.Encode(text)
var url string = "http://www.plantuml.com/plantuml/img/" + encoded
resp, err := http.Get(url)

The retrieved diagram:

alt tag

Decode() example

const cipher = "SYWkIImgAStDuN8jIrNGjLDmoazIi5B8ICt9oUToICrBAStD0GG00F__"
plain, err := plantuml.Decode(cipher)
log.Println(plain)
/*
@startuml
Eve -> Bob : hello
@enduml
*/

test

go test -v

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(encoded string) (string, error)

func Encode

func Encode(text string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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