MCPcopy Index your code
hub / github.com/docker/docker-agent / SessionToFile

Function SessionToFile

pkg/app/export/html.go:83–90  ·  view source on GitHub ↗

SessionToFile exports a session to an HTML file. If filename is empty, a default name based on the title and timestamp is used. Returns the absolute path of the created file.

(sess *session.Session, agentDescription, filename string)

Source from the content-addressed store, hash-verified

81// If filename is empty, a default name based on the title and timestamp is used.
82// Returns the absolute path of the created file.
83func SessionToFile(sess *session.Session, agentDescription, filename string) (string, error) {
84 if sess == nil {
85 return "", errors.New("no session to export")
86 }
87 data := sessionToData(sess)
88 data.AgentDescription = agentDescription
89 return ToFile(data, filename)
90}
91
92func sessionToData(sess *session.Session) SessionData {
93 messages := sess.GetAllMessages()

Callers 1

ExportHTMLMethod · 0.92

Calls 3

sessionToDataFunction · 0.85
ToFileFunction · 0.85
NewMethod · 0.45

Tested by

no test coverage detected