package output import ( "fmt" ) type stdoutput struct { } func StdOutput() *stdoutput { return &stdoutput{} } func (so *stdoutput) Write(post Post) (Ref, error) { if post.ReplyTo != nil { fmt.Printf("[reply to: %s]\n", post.ReplyTo.ID) } fmt.Println(post.Text) for _, img := range post.Images { fmt.Printf("[image: %s (%s, %d bytes)]\n", img.Filename, img.ContentType, len(img.Data)) } return Ref{ID: post.Text}, nil } func (so *stdoutput) Delete(ref Ref) error { fmt.Printf("[deleted: %s]\n", ref.ID) return nil } func (so *stdoutput) GetName() string { return "stdout" }