sequence

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package sequence is mermaid sequence diagram builder.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagram

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

Diagram is a sequence diagram builder.

func NewDiagram

func NewDiagram(w io.Writer, opts ...Option) *Diagram

NewDiagram returns a new Diagram. Currently, there is no option (method) provided to change the configuration.

func (*Diagram) Activate

func (d *Diagram) Activate(participant string) *Diagram

Activate add a participant to the sequence diagram.

func (*Diagram) Actor

func (d *Diagram) Actor(actor string) *Diagram

Actor add a participant to the sequence diagram.

func (*Diagram) AltElse

func (d *Diagram) AltElse(description string) *Diagram

AltElse add a alt to the sequence diagram.

func (*Diagram) AltEnd

func (d *Diagram) AltEnd() *Diagram

AltEnd add a alt to the sequence diagram.

func (*Diagram) AltStart

func (d *Diagram) AltStart(description string) *Diagram

AltStart add a alt to the sequence diagram.

func (*Diagram) AsyncRequest

func (d *Diagram) AsyncRequest(from, to, message string) *Diagram

AsyncRequest add a async request to the sequence diagram.

func (*Diagram) AsyncRequestWithActivation

func (d *Diagram) AsyncRequestWithActivation(from, to, message string) *Diagram

AsyncRequestWithActivation add a async request to the sequence diagram.

func (*Diagram) AsyncRequestf

func (d *Diagram) AsyncRequestf(from, to, format string, args ...any) *Diagram

AsyncRequestf add a async request to the sequence diagram.

func (*Diagram) AsyncRequestfWithActivation

func (d *Diagram) AsyncRequestfWithActivation(from, to, format string, args ...any) *Diagram

AsyncRequestfWithActivation add a async request to the sequence diagram.

func (*Diagram) AsyncResponse

func (d *Diagram) AsyncResponse(from, to, message string) *Diagram

AsyncResponse add a async response to the sequence diagram.

func (*Diagram) AsyncResponseWithActivation

func (d *Diagram) AsyncResponseWithActivation(from, to, message string) *Diagram

AsyncResponseWithActivation add a async response to the sequence diagram.

func (*Diagram) AsyncResponsef

func (d *Diagram) AsyncResponsef(from, to, format string, args ...any) *Diagram

AsyncResponsef add a async response to the sequence diagram.

func (*Diagram) AsyncResponsefWithActivation

func (d *Diagram) AsyncResponsefWithActivation(from, to, format string, args ...any) *Diagram

AsyncResponsefWithActivation add a async response to the sequence diagram.

func (*Diagram) AutoNumber

func (d *Diagram) AutoNumber() *Diagram

AutoNumber add auto number to the sequence diagram.

func (*Diagram) BoxEnd

func (d *Diagram) BoxEnd() *Diagram

BoxEnd add a box to the sequence diagram.

func (*Diagram) BoxStart

func (d *Diagram) BoxStart(participant []string) *Diagram

BoxStart add a box to the sequence diagram.

func (*Diagram) BreakEnd

func (d *Diagram) BreakEnd() *Diagram

BreakEnd add a break to the sequence diagram.

func (*Diagram) BreakStart

func (d *Diagram) BreakStart(description string) *Diagram

BreakStart add a break to the sequence diagram.

func (*Diagram) Build

func (d *Diagram) Build() error

Build writes the sequence diagram body to the output destination.

func (*Diagram) CreateActor

func (d *Diagram) CreateActor(actor string) *Diagram

CreateActor add a participant to the sequence diagram.

func (*Diagram) CreateParticipant

func (d *Diagram) CreateParticipant(participant string) *Diagram

CreateParticipant add a participant to the sequence diagram.

func (*Diagram) CriticalEnd

func (d *Diagram) CriticalEnd() *Diagram

CriticalEnd add a critical to the sequence diagram.

func (*Diagram) CriticalOption

func (d *Diagram) CriticalOption(description string) *Diagram

CriticalOption add a critical opiton to the sequence diagram.

func (*Diagram) CriticalStart

func (d *Diagram) CriticalStart(description string) *Diagram

CriticalStart add a critical to the sequence diagram.

func (*Diagram) Deactivate

func (d *Diagram) Deactivate(participant string) *Diagram

Deactivate add a participant to the sequence diagram.

func (*Diagram) DestroyActor

func (d *Diagram) DestroyActor(actor string) *Diagram

DestroyActor add a participant to the sequence diagram.

func (*Diagram) DestroyParticipant

func (d *Diagram) DestroyParticipant(participant string) *Diagram

DestroyParticipant add a participant to the sequence diagram.

func (*Diagram) Error

func (d *Diagram) Error() error

Error returns the error that occurred during the sequence diagram building.

func (*Diagram) LF

func (d *Diagram) LF() *Diagram

LF add a line feed to the sequence diagram.

func (*Diagram) LoopEnd

func (d *Diagram) LoopEnd() *Diagram

LoopEnd add a loop to the sequence diagram.

func (*Diagram) LoopStart

func (d *Diagram) LoopStart(description string) *Diagram

LoopStart add a loop to the sequence diagram.

func (*Diagram) NoteLeftOf

func (d *Diagram) NoteLeftOf(participant, message string) *Diagram

NoteLeftOf add a note to the sequence diagram.

func (*Diagram) NoteOver

func (d *Diagram) NoteOver(participant, message string) *Diagram

NoteOver add a note to the sequence diagram.

func (*Diagram) NoteRightOf

func (d *Diagram) NoteRightOf(participant, message string) *Diagram

NoteRightOf add a note to the sequence diagram.

func (*Diagram) OptEnd

func (d *Diagram) OptEnd() *Diagram

OptEnd add a opt to the sequence diagram.

func (*Diagram) OptStart

func (d *Diagram) OptStart(description string) *Diagram

OptStart add a opt to the sequence diagram.

func (*Diagram) ParallelAnd

func (d *Diagram) ParallelAnd(description string) *Diagram

ParallelAnd add a parallel to the sequence diagram.

func (*Diagram) ParallelEnd

func (d *Diagram) ParallelEnd() *Diagram

ParallelEnd add a parallel to the sequence diagram.

func (*Diagram) ParallelStart

func (d *Diagram) ParallelStart(description string) *Diagram

ParallelStart add a parallel to the sequence diagram.

func (*Diagram) Participant

func (d *Diagram) Participant(participant string) *Diagram

Participant add a participant to the sequence diagram.

func (*Diagram) RequestError

func (d *Diagram) RequestError(from, to, message string) *Diagram

RequestError add a request error to the sequence diagram.

func (*Diagram) RequestErrorf

func (d *Diagram) RequestErrorf(from, to, format string, args ...any) *Diagram

RequestErrorf add a request error to the sequence diagram.

func (*Diagram) ResponseError

func (d *Diagram) ResponseError(from, to, message string) *Diagram

ResponseError add a response error to the sequence diagram.

func (*Diagram) ResponseErrorf

func (d *Diagram) ResponseErrorf(from, to, format string, args ...any) *Diagram

ResponseErrorf add a response error to the sequence diagram.

func (*Diagram) String

func (d *Diagram) String() string

String returns the sequence diagram body.

func (*Diagram) SyncRequest

func (d *Diagram) SyncRequest(from, to, message string) *Diagram

SyncRequest add a request to the sequence diagram.

func (*Diagram) SyncRequestWithActivation

func (d *Diagram) SyncRequestWithActivation(from, to, message string) *Diagram

SyncRequestWithActivation add a request to the sequence diagram.

func (*Diagram) SyncRequestf

func (d *Diagram) SyncRequestf(from, to, format string, args ...any) *Diagram

SyncRequestf add a request to the sequence diagram.

func (*Diagram) SyncRequestfWithActivation

func (d *Diagram) SyncRequestfWithActivation(from, to, format string, args ...any) *Diagram

SyncRequestfWithActivation add a request to the sequence diagram.

func (*Diagram) SyncResponse

func (d *Diagram) SyncResponse(from, to, message string) *Diagram

SyncResponse add a response to the sequence diagram.

func (*Diagram) SyncResponseWithActivation

func (d *Diagram) SyncResponseWithActivation(from, to, message string) *Diagram

SyncResponseWithActivation add a response to the sequence diagram.

func (*Diagram) SyncResponsef

func (d *Diagram) SyncResponsef(from, to, format string, args ...any) *Diagram

SyncResponsef add a response to the sequence diagram.

func (*Diagram) SyncResponsefWithActivation

func (d *Diagram) SyncResponsefWithActivation(from, to, format string, args ...any) *Diagram

SyncResponsefWithActivation 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"
)

type Option added in v0.2.0

type Option func(*config)

Option sets the options for the Diagram struct.

func WithActorFontFamily added in v0.2.0

func WithActorFontFamily(actorFontFamily string) Option

WithActorFontFamily sets the actorFontFamily configuration.

func WithActorFontSize added in v0.2.0

func WithActorFontSize(actorFontSize uint) Option

WithActorFontSize sets the actorFontSize configuration.

func WithActorFontWeight added in v0.2.0

func WithActorFontWeight(actorFontWeight string) Option

WithActorFontWeight sets the actorFontWeight configuration.

func WithBottomMariginAdjustment added in v0.2.0

func WithBottomMariginAdjustment(bottomMariginAdjustment uint) Option

WithBottomMariginAdjustment sets the bottomMariginAdjustment configuration.

func WithMessageFontFamily added in v0.2.0

func WithMessageFontFamily(messageFontFamily string) Option

WithMessageFontFamily sets the messageFontFamily configuration.

func WithMessageFontSize added in v0.2.0

func WithMessageFontSize(messageFontSize uint) Option

WithMessageFontSize sets the messageFontSize configuration.

func WithMessageFontWeight added in v0.2.0

func WithMessageFontWeight(messageFontWeight string) Option

WithMessageFontWeight sets the messageFontWeight configuration.

func WithMirrorActors added in v0.2.0

func WithMirrorActors(mirrorActors bool) Option

WithMirrorActors sets the mirrorActors configuration.

func WithNoteAlign added in v0.2.0

func WithNoteAlign(noteAlign string) Option

WithNoteAlign sets the noteAlign configuration.

func WithNoteFontFamily added in v0.2.0

func WithNoteFontFamily(noteFontFamily string) Option

WithNoteFontFamily sets the noteFontFamily configuration.

func WithNoteFontSize added in v0.2.0

func WithNoteFontSize(noteFontSize uint) Option

WithNoteFontSize sets the noteFontSize configuration.

func WithNoteFontWeight added in v0.2.0

func WithNoteFontWeight(noteFontWeight string) Option

WithNoteFontWeight sets the noteFontWeight configuration.

Jump to

Keyboard shortcuts

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