Documentation
¶
Overview ¶
Package sequence is mermaid sequence diagram builder.
Index ¶
- type Config
- type Diagram
- func (d *Diagram) Activate(participant string) *Diagram
- func (d *Diagram) Actor(actor string) *Diagram
- func (d *Diagram) AltElse(description string) *Diagram
- func (d *Diagram) AltEnd() *Diagram
- func (d *Diagram) AltStart(description string) *Diagram
- func (d *Diagram) AsyncRequest(from, to, message string) *Diagram
- func (d *Diagram) AsyncRequestWithActivation(from, to, message string) *Diagram
- func (d *Diagram) AsyncRequestf(from, to, format string, args ...any) *Diagram
- func (d *Diagram) AsyncRequestfWithActivation(from, to, format string, args ...any) *Diagram
- func (d *Diagram) AsyncResponse(from, to, message string) *Diagram
- func (d *Diagram) AsyncResponseWithActivation(from, to, message string) *Diagram
- func (d *Diagram) AsyncResponsef(from, to, format string, args ...any) *Diagram
- func (d *Diagram) AsyncResponsefWithActivation(from, to, format string, args ...any) *Diagram
- func (d *Diagram) AutoNumber() *Diagram
- func (d *Diagram) BoxEnd() *Diagram
- func (d *Diagram) BoxStart(participant []string) *Diagram
- func (d *Diagram) BreakEnd() *Diagram
- func (d *Diagram) BreakStart(description string) *Diagram
- func (d *Diagram) Build() error
- func (d *Diagram) CreateActor(actor string) *Diagram
- func (d *Diagram) CreateParticipant(participant string) *Diagram
- func (d *Diagram) CriticalEnd() *Diagram
- func (d *Diagram) CriticalOption(description string) *Diagram
- func (d *Diagram) CriticalStart(description string) *Diagram
- func (d *Diagram) Deactivate(participant string) *Diagram
- func (d *Diagram) DestroyActor(actor string) *Diagram
- func (d *Diagram) DestroyParticipant(participant string) *Diagram
- func (d *Diagram) Error() error
- func (d *Diagram) LF() *Diagram
- func (d *Diagram) LoopEnd() *Diagram
- func (d *Diagram) LoopStart(description string) *Diagram
- func (d *Diagram) NoteLeftOf(participant, message string) *Diagram
- func (d *Diagram) NoteOver(participant, message string) *Diagram
- func (d *Diagram) NoteRightOf(participant, message string) *Diagram
- func (d *Diagram) OptEnd() *Diagram
- func (d *Diagram) OptStart(description string) *Diagram
- func (d *Diagram) ParallelAnd(description string) *Diagram
- func (d *Diagram) ParallelEnd() *Diagram
- func (d *Diagram) ParallelStart(description string) *Diagram
- func (d *Diagram) Participant(participant string) *Diagram
- func (d *Diagram) RequestError(from, to, message string) *Diagram
- func (d *Diagram) RequestErrorf(from, to, format string, args ...any) *Diagram
- func (d *Diagram) ResponseError(from, to, message string) *Diagram
- func (d *Diagram) ResponseErrorf(from, to, format string, args ...any) *Diagram
- func (d *Diagram) String() string
- func (d *Diagram) SyncRequest(from, to, message string) *Diagram
- func (d *Diagram) SyncRequestWithActivation(from, to, message string) *Diagram
- func (d *Diagram) SyncRequestf(from, to, format string, args ...any) *Diagram
- func (d *Diagram) SyncRequestfWithActivation(from, to, format string, args ...any) *Diagram
- func (d *Diagram) SyncResponse(from, to, message string) *Diagram
- func (d *Diagram) SyncResponseWithActivation(from, to, message string) *Diagram
- func (d *Diagram) SyncResponsef(from, to, format string, args ...any) *Diagram
- func (d *Diagram) SyncResponsefWithActivation(from, to, format string, args ...any) *Diagram
- type NotePosition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // MirrorActors turns on/off the rendering of actors // below the diagram as well as above it. // Default is false. MirrorActors bool // BottomMariginAdjustment Adjusts how far down the graph ended. // Wide borders styles with css could generate unwanted clipping which is why this config param exists. // Default is 1. BottomMariginAdjustment uint // ActorFontSize is the font size of the actors. // Default is 14. ActorFontSize uint // ActorFontFamily sets the font family for the actor's description. // Default is "Open Sans", sans-serif. ActorFontFamily string // ActorFontWeight sets the font weight for the actor's description // Default is "Open Sans", sans-serif. ActorFontWeight string // NoteFontSize is the font size of the notes. // Default is 14. NoteFontSize uint // NoteFontFamily sets the font family for the note's description. // Default is "trebuchet ms", verdana, arial NoteFontFamily string // NoteFontWeight sets the font weight for the note's description. // Default is "trebuchet ms", verdana, arial NoteFontWeight string // NoteAlign sets the alignment of the note's description. // Default is "center" NoteAlign string // MessageFontSize is the font size of the messages. // Default is 16. MessageFontSize uint // MessageFontFamily sets the font family for actor<->actor messages // Default is "trebuchet ms", verdana, arial MessageFontFamily string // MessageFontWeight sets the font weight for actor<->actor messages // Default is "trebuchet ms", verdana, arial MessageFontWeight string }
Config is the configuration for the sequence diagram. Ref. https://mermaid.js.org/syntax/sequenceDiagram.html
type Diagram ¶
type Diagram struct {
// contains filtered or unexported fields
}
Diagram is a sequence diagram builder.
func NewDiagram ¶
NewDiagram returns a new Diagram. Now, Config is not used.
func (*Diagram) AsyncRequest ¶
AsyncRequest add a async request to the sequence diagram.
func (*Diagram) AsyncRequestWithActivation ¶
AsyncRequestWithActivation add a async request to the sequence diagram.
func (*Diagram) AsyncRequestf ¶
AsyncRequestf add a async request to the sequence diagram.
func (*Diagram) AsyncRequestfWithActivation ¶
AsyncRequestfWithActivation add a async request to the sequence diagram.
func (*Diagram) AsyncResponse ¶
AsyncResponse add a async response to the sequence diagram.
func (*Diagram) AsyncResponseWithActivation ¶
AsyncResponseWithActivation add a async response to the sequence diagram.
func (*Diagram) AsyncResponsef ¶
AsyncResponsef add a async response to the sequence diagram.
func (*Diagram) AsyncResponsefWithActivation ¶
AsyncResponsefWithActivation add a async response to the sequence diagram.
func (*Diagram) AutoNumber ¶
AutoNumber add auto number to the sequence diagram.
func (*Diagram) BreakStart ¶
BreakStart add a break to the sequence diagram.
func (*Diagram) CreateActor ¶
CreateActor add a participant to the sequence diagram.
func (*Diagram) CreateParticipant ¶
CreateParticipant add a participant to the sequence diagram.
func (*Diagram) CriticalEnd ¶
CriticalEnd add a critical to the sequence diagram.
func (*Diagram) CriticalOption ¶
CriticalOption add a critical opiton to the sequence diagram.
func (*Diagram) CriticalStart ¶
CriticalStart add a critical to the sequence diagram.
func (*Diagram) Deactivate ¶
Deactivate add a participant to the sequence diagram.
func (*Diagram) DestroyActor ¶
DestroyActor add a participant to the sequence diagram.
func (*Diagram) DestroyParticipant ¶
DestroyParticipant add a participant to the sequence diagram.
func (*Diagram) NoteLeftOf ¶
NoteLeftOf add a note to the sequence diagram.
func (*Diagram) NoteRightOf ¶
NoteRightOf add a note to the sequence diagram.
func (*Diagram) ParallelAnd ¶
ParallelAnd add a parallel to the sequence diagram.
func (*Diagram) ParallelEnd ¶
ParallelEnd add a parallel to the sequence diagram.
func (*Diagram) ParallelStart ¶
ParallelStart add a parallel to the sequence diagram.
func (*Diagram) Participant ¶
Participant add a participant to the sequence diagram.
func (*Diagram) RequestError ¶
RequestError add a request error to the sequence diagram.
func (*Diagram) RequestErrorf ¶
RequestErrorf add a request error to the sequence diagram.
func (*Diagram) ResponseError ¶
ResponseError add a response error to the sequence diagram.
func (*Diagram) ResponseErrorf ¶
ResponseErrorf add a response error to the sequence diagram.
func (*Diagram) SyncRequest ¶
SyncRequest add a request to the sequence diagram.
func (*Diagram) SyncRequestWithActivation ¶
SyncRequestWithActivation add a request to the sequence diagram.
func (*Diagram) SyncRequestf ¶
SyncRequestf add a request to the sequence diagram.
func (*Diagram) SyncRequestfWithActivation ¶
SyncRequestfWithActivation add a request to the sequence diagram.
func (*Diagram) SyncResponse ¶
SyncResponse add a response to the sequence diagram.
func (*Diagram) SyncResponseWithActivation ¶
SyncResponseWithActivation add a response to the sequence diagram.
func (*Diagram) SyncResponsef ¶
SyncResponsef add a response to the sequence diagram.
type NotePosition ¶
type NotePosition string
NotePosition is a note position.
const ( // NotePositionOver is a note position. NotePositionOver NotePosition = "over" // NotePositionRight is a note position. NotePositionRight NotePosition = "right of" // NotePositionLeft is a note position. NotePositionLeft NotePosition = "left of" )