Documentation
¶
Index ¶
- func NewD2OracleRepository() repository.OracleRepository
- func NewD2OracleRepositoryWithSecurity(config SecurityConfig) (repository.OracleRepository, error)
- func NewD2Repository() repository.DiagramRepository
- func NewD2RepositoryWithSecurity(config SecurityConfig) (repository.DiagramRepository, error)
- type D2OracleRepository
- func (r *D2OracleRepository) CreateElement(ctx context.Context, diagramID string, boardPath []string, key string) (*entity.OracleResult, error)
- func (r *D2OracleRepository) DeleteElement(ctx context.Context, diagramID string, boardPath []string, key string) (*entity.OracleResult, error)
- func (r *D2OracleRepository) GetChildren(ctx context.Context, diagramID string, boardPath []string, parentID string) ([]string, error)
- func (r *D2OracleRepository) GetContent(ctx context.Context, diagramID string) (string, error)
- func (r *D2OracleRepository) GetEdge(ctx context.Context, diagramID string, boardPath []string, edgeID string) (*entity.GraphEdge, error)
- func (r *D2OracleRepository) GetObject(ctx context.Context, diagramID string, boardPath []string, objectID string) (*entity.GraphObject, error)
- func (r *D2OracleRepository) LoadDiagram(ctx context.Context, diagramID string, content string) error
- func (r *D2OracleRepository) MoveElement(ctx context.Context, diagramID string, boardPath []string, key, newKey string, ...) (*entity.OracleResult, error)
- func (r *D2OracleRepository) RenameElement(ctx context.Context, diagramID string, boardPath []string, key, newName string) (*entity.OracleResult, error)
- func (r *D2OracleRepository) ReplaceContent(ctx context.Context, diagramID, content string) error
- func (r *D2OracleRepository) SerializeDiagram(ctx context.Context, diagramID string) (string, error)
- func (r *D2OracleRepository) SetAttribute(ctx context.Context, diagramID string, boardPath []string, key string, ...) (*entity.OracleResult, error)
- type D2Repository
- func (r *D2Repository) Create(ctx context.Context, diagram *entity.Diagram) error
- func (r *D2Repository) Export(ctx context.Context, diagramID string, format entity.ExportFormat) (io.Reader, error)
- func (r *D2Repository) ExportWithOptions(ctx context.Context, diagramID string, format entity.ExportFormat, ...) (io.Reader, error)
- func (r *D2Repository) FormatContent(ctx context.Context, content string) (string, error)
- func (r *D2Repository) GetContent(ctx context.Context, diagramID string) (string, error)
- func (r *D2Repository) Render(ctx context.Context, content string, format entity.ExportFormat, ...) (io.Reader, error)
- func (r *D2Repository) RenderWithOptions(ctx context.Context, content string, format entity.ExportFormat, ...) (io.Reader, error)
- func (r *D2Repository) ReplaceContent(ctx context.Context, diagramID, content string) error
- func (r *D2Repository) Validate(ctx context.Context, content string) (*entity.DiagramValidationResult, error)
- type OracleSession
- type SecurityConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewD2OracleRepository ¶
func NewD2OracleRepository() repository.OracleRepository
NewD2OracleRepository creates a new D2 repository with Oracle support.
func NewD2OracleRepositoryWithSecurity ¶
func NewD2OracleRepositoryWithSecurity(config SecurityConfig) (repository.OracleRepository, error)
NewD2OracleRepositoryWithSecurity creates an Oracle repository with explicit security dependencies.
func NewD2Repository ¶
func NewD2Repository() repository.DiagramRepository
NewD2Repository creates a D2 repository secured to the current working directory.
func NewD2RepositoryWithSecurity ¶
func NewD2RepositoryWithSecurity(config SecurityConfig) (repository.DiagramRepository, error)
NewD2RepositoryWithSecurity creates a D2 repository with explicit security dependencies.
Types ¶
type D2OracleRepository ¶
type D2OracleRepository struct {
*D2Repository
// contains filtered or unexported fields
}
D2OracleRepository extends D2Repository with Oracle capabilities
func (*D2OracleRepository) CreateElement ¶
func (r *D2OracleRepository) CreateElement(ctx context.Context, diagramID string, boardPath []string, key string) (*entity.OracleResult, error)
CreateElement creates a new shape or connection
func (*D2OracleRepository) DeleteElement ¶
func (r *D2OracleRepository) DeleteElement(ctx context.Context, diagramID string, boardPath []string, key string) (*entity.OracleResult, error)
DeleteElement deletes a shape or connection
func (*D2OracleRepository) GetChildren ¶
func (r *D2OracleRepository) GetChildren(ctx context.Context, diagramID string, boardPath []string, parentID string) ([]string, error)
GetChildren retrieves child element IDs
func (*D2OracleRepository) GetContent ¶
GetContent returns the current source, including Oracle edits.
func (*D2OracleRepository) GetEdge ¶
func (r *D2OracleRepository) GetEdge(ctx context.Context, diagramID string, boardPath []string, edgeID string) (*entity.GraphEdge, error)
GetEdge retrieves edge information
func (*D2OracleRepository) GetObject ¶
func (r *D2OracleRepository) GetObject(ctx context.Context, diagramID string, boardPath []string, objectID string) (*entity.GraphObject, error)
GetObject retrieves object information
func (*D2OracleRepository) LoadDiagram ¶
func (r *D2OracleRepository) LoadDiagram(ctx context.Context, diagramID string, content string) error
LoadDiagram loads a diagram from D2 text.
func (*D2OracleRepository) MoveElement ¶
func (r *D2OracleRepository) MoveElement(ctx context.Context, diagramID string, boardPath []string, key, newKey string, includeDescendants bool) (*entity.OracleResult, error)
MoveElement moves a shape to a new container
func (*D2OracleRepository) RenameElement ¶
func (r *D2OracleRepository) RenameElement(ctx context.Context, diagramID string, boardPath []string, key, newName string) (*entity.OracleResult, error)
RenameElement renames a shape or connection
func (*D2OracleRepository) ReplaceContent ¶
func (r *D2OracleRepository) ReplaceContent(ctx context.Context, diagramID, content string) error
ReplaceContent validates content before atomically replacing stored source.
func (*D2OracleRepository) SerializeDiagram ¶
func (r *D2OracleRepository) SerializeDiagram(ctx context.Context, diagramID string) (string, error)
SerializeDiagram converts the current graph state back to D2 text
func (*D2OracleRepository) SetAttribute ¶
func (r *D2OracleRepository) SetAttribute(ctx context.Context, diagramID string, boardPath []string, key string, tag, value *string) (*entity.OracleResult, error)
SetAttribute sets attributes on a shape or connection
type D2Repository ¶
type D2Repository struct {
// contains filtered or unexported fields
}
D2Repository implements the DiagramRepository interface using D2.
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) ExportWithOptions ¶
func (r *D2Repository) ExportWithOptions(ctx context.Context, diagramID string, format entity.ExportFormat, options entity.RenderOptions) (io.Reader, error)
ExportWithOptions exports a stored diagram using typed D2 v0.9 options.
func (*D2Repository) FormatContent ¶
FormatContent formats valid D2 source without storing it.
func (*D2Repository) GetContent ¶
GetContent returns the stored D2 source.
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 with backward-compatible theme handling.
func (*D2Repository) RenderWithOptions ¶
func (r *D2Repository) RenderWithOptions(ctx context.Context, content string, format entity.ExportFormat, options entity.RenderOptions) (io.Reader, error)
RenderWithOptions renders content entirely through public D2 v0.9 Go APIs.
func (*D2Repository) ReplaceContent ¶
func (r *D2Repository) ReplaceContent(ctx context.Context, diagramID, content string) error
ReplaceContent validates content before atomically replacing stored source.
func (*D2Repository) Validate ¶
func (r *D2Repository) Validate(ctx context.Context, content string) (*entity.DiagramValidationResult, error)
Validate validates D2 source and normalizes compiler diagnostics.