Documentation
¶
Index ¶
- func GenerateFromCFG(filename string) (string, error)
- type SectionConfig
- type Sequence
- func (s *Sequence) Actors() []string
- func (s *Sequence) AddActors(actors ...string)
- func (s *Sequence) AddStep(step Step)
- func (s *Sequence) AppendActors(actors ...string)
- func (s *Sequence) CloseAllSections()
- func (s *Sequence) CloseSection()
- func (s *Sequence) Generate() (string, error)
- func (s *Sequence) OpenSection(name string, cfg *SectionConfig)
- func (s *Sequence) SetDistance(d int)
- func (s *Sequence) SetHeight(height string)
- func (s *Sequence) SetStepHeight(h int)
- func (s *Sequence) SetVerticalSectionText(b bool)
- func (s *Sequence) SetWidth(width string)
- type Step
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateFromCFG ¶
GenerateFromCFG generates the sequence by parsing a config file
Types ¶
type SectionConfig ¶ added in v0.0.16
type SectionConfig struct {
Color string // Optional CSS color value (e.g., " #ff0000", "red").
WithoutBorder bool // Section is drawn without a border.
}
SectionConfig holds optional configuration for a section.
type Sequence ¶
type Sequence struct {
// contains filtered or unexported fields
}
func NewSequence ¶
func NewSequence() *Sequence
func (*Sequence) AddActors ¶
AddActors adds the given actors to the sequence, in order.
Use this to ensure the order of the actors in the sequence.
func (*Sequence) AppendActors ¶ added in v0.0.13
AppendActors ensures that an actor exists if it does not, the actor is appended (thus appears the last)
func (*Sequence) CloseAllSections ¶ added in v0.0.6
func (s *Sequence) CloseAllSections()
CloseAllSections closes all the sections. Use only if you cannot guarantee an open/close sequence for the sections.
func (*Sequence) CloseSection ¶
func (s *Sequence) CloseSection()
CloseSection closes the last open section
func (*Sequence) OpenSection ¶
func (s *Sequence) OpenSection(name string, cfg *SectionConfig)
OpenSection opens a new section to the sequence diagram. An open section must be closed after adding the steps which should be placed in it.
Parameters:
- name: Required name of the section.
- config: Optional 'SectionConfig' configuration. Pass nil to use defaults.
func (*Sequence) SetDistance ¶
SetDistance sets the distance between actors
func (*Sequence) SetHeight ¶
SetHeight sets the SVG height.
Any CSS value for size is valid, including pixels or percentages.
func (*Sequence) SetStepHeight ¶ added in v0.0.7
SetStepHeight sets the height of each step in the sequence.
func (*Sequence) SetVerticalSectionText ¶ added in v0.0.11
SetVerticalSectionText sets the section text vertically on the left
type Step ¶
type Step struct {
// Text: Optional text displayed above the arrow or mark.
Text string
// Source: Required name of the actor that initiates the action.
Source string
// Target: Required name of the actor that receives the action.
//
// It can be the same as sourceActor.
Target string
// Color: Optional CSS color value (e.g., "#ff0000", "red").
//
// Pass an empty string to use the default color.
Color string
// contains filtered or unexported fields
}