kroki

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KrokiClient

type KrokiClient struct {
	Host string
}

func NewKrokiClient

func NewKrokiClient(host string) *KrokiClient

func (*KrokiClient) GetDiagramURL

func (kc *KrokiClient) GetDiagramURL(diagramType, diagramSource string, format model.OutputFormat) (string, error)

GetDiagramURL generates a URL for the Kroki API to fetch the diagram. It encodes the diagram source and appends it to the Kroki host URL.

func (*KrokiClient) RenderDiagram

func (kc *KrokiClient) RenderDiagram(diagramType, diagramSource string, format model.OutputFormat) (*KrokiResult, error)

RenderDiagram sends diagram code to the Kroki server and returns both image base64 and a direct URL.

type KrokiResult

type KrokiResult struct {
	ImageContent []byte `json:"-"` // The image content in base64 format
	MIMEType     string `json:"-"`
}

Jump to

Keyboard shortcuts

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