d2

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewD2Repository

func NewD2Repository() repository.DiagramRepository

NewD2Repository creates a new D2 repository instance.

Types

type D2Repository

type D2Repository struct {
	// contains filtered or unexported fields
}

D2Repository implements the DiagramRepository interface using D2.

func (*D2Repository) Create

func (r *D2Repository) Create(ctx context.Context, diagram *entity.Diagram) error

Create creates a new diagram programmatically.

func (*D2Repository) Export

func (r *D2Repository) Export(ctx context.Context, diagramID string, format entity.ExportFormat) (io.Reader, error)

Export exports the diagram to the specified format.

func (*D2Repository) Render

func (r *D2Repository) Render(ctx context.Context, content string, format entity.ExportFormat, theme *entity.Theme) (io.Reader, error)

Render renders D2 text into a diagram with specified format.

Jump to

Keyboard shortcuts

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