sriracha/extension/attach_jpg.go

32 lines
501 B
Go

package extension
import (
"io"
"log"
"code.rocketnine.space/tslocum/sriracha"
)
type attachJPG struct {
}
var _ sriracha.ExtensionAttach = &attachJPG{}
func AttachJPG() *attachJPG {
return &attachJPG{}
}
func (a *attachJPG) Description() string {
//TODO implement me
panic("implement me")
}
func (a *attachJPG) Attach(file io.Reader, size int64, mime string) (*sriracha.Attachment, error) {
if mime != "image/jpeg" {
return nil, nil
}
log.Println("Hello, JPG!")
return nil, nil
}