Documentation
¶
Overview ¶
Package canvas provides high-level operations for Aha.io strategic canvases.
Index ¶
- Variables
- func BlocksForKind(kind Kind) []string
- func Create(ctx context.Context, client *aha.Client, opts CreateOptions) (*aha.StrategicModel, error)
- func Export(ctx context.Context, client *aha.Client, opts ExportOptions) ([]byte, error)
- func ExportModel(sm *aha.StrategicModel, opts ExportOptions) ([]byte, error)
- func GetAvailableBlocks(ctx context.Context, client *aha.Client, canvasID string) ([]string, error)
- func LoadBlocksFromFile(path string) (map[string]string, error)
- type BlockError
- type CreateOptions
- type ExportFormat
- type ExportOptions
- type Kind
- type UpdateOptions
- type UpdateResult
Constants ¶
This section is empty.
Variables ¶
var BMCBlocks = []string{
"Key Partners",
"Key Activities",
"Key Resources",
"Value Propositions",
"Customer Relationships",
"Channels",
"Customer Segments",
"Cost Structure",
"Revenue Streams",
}
BMCBlocks defines the standard block names for Business Model Canvas.
var LeanUXBlocks = []string{
"Business Problem",
"Business Outcomes",
"Users",
"Benefits",
"Solutions",
"Hypotheses",
"Riskiest Assumption",
"Smallest Experiment",
}
LeanUXBlocks defines the standard block names for Lean UX Canvas.
var OpportunityBlocks = []string{
"Users & Customers",
"Problems",
"Solution Ideas",
"Solutions Today",
"User Value",
"Adoption Strategy",
"User Metrics",
"Business Problem",
"Business Metrics",
"Budget",
}
OpportunityBlocks defines the standard block names for Opportunity Canvas.
Functions ¶
func BlocksForKind ¶
BlocksForKind returns the standard block names for a canvas kind.
func Create ¶
func Create(ctx context.Context, client *aha.Client, opts CreateOptions) (*aha.StrategicModel, error)
Create creates a new strategic canvas in Aha.io.
func ExportModel ¶
func ExportModel(sm *aha.StrategicModel, opts ExportOptions) ([]byte, error)
ExportModel exports a strategic model to the specified format. This function is useful for testing without an API call.
func GetAvailableBlocks ¶
GetAvailableBlocks returns the available block names for a canvas.
Types ¶
type BlockError ¶
BlockError represents an error updating a specific block.
type CreateOptions ¶
CreateOptions configures canvas creation.
type ExportFormat ¶
type ExportFormat string
ExportFormat represents an export format.
const ( FormatSVG ExportFormat = "svg" FormatJSON ExportFormat = "json" FormatD2 ExportFormat = "d2" FormatMermaid ExportFormat = "mermaid" )
Export formats.
func SupportedFormats ¶
func SupportedFormats() []ExportFormat
SupportedFormats returns the list of supported export formats.
type ExportOptions ¶
type ExportOptions struct {
CanvasID string
Format ExportFormat
Width int
Height int
}
ExportOptions configures canvas export.
func DefaultExportOptions ¶
func DefaultExportOptions() ExportOptions
DefaultExportOptions returns default export options.
type UpdateOptions ¶
type UpdateOptions struct {
CanvasID string
Blocks map[string]string // Block name -> HTML content
}
UpdateOptions configures canvas update.
type UpdateResult ¶
type UpdateResult struct {
SuccessCount int
ErrorCount int
Errors []BlockError
Unknown []string // Block names not found in canvas
}
UpdateResult contains the result of an update operation.
func Update ¶
func Update(ctx context.Context, client *aha.Client, opts UpdateOptions) (*UpdateResult, error)
Update updates canvas blocks with new content.