...

Source file src/code.rocketnine.space/tslocum/sriracha/extension/attach_jpg.go

Documentation: code.rocketnine.space/tslocum/sriracha/extension

     1  package extension
     2  
     3  import (
     4  	"io"
     5  	"log"
     6  
     7  	"code.rocketnine.space/tslocum/sriracha"
     8  )
     9  
    10  type attachJPG struct {
    11  }
    12  
    13  var _ sriracha.ExtensionAttach = &attachJPG{}
    14  
    15  func AttachJPG() *attachJPG {
    16  	return &attachJPG{}
    17  }
    18  
    19  func (a *attachJPG) Description() string {
    20  	//TODO implement me
    21  	panic("implement me")
    22  }
    23  
    24  func (a *attachJPG) Attach(file io.Reader, size int64, mime string) (*sriracha.Attachment, error) {
    25  	if mime != "image/jpeg" {
    26  		return nil, nil
    27  	}
    28  
    29  	log.Println("Hello, JPG!")
    30  	return nil, nil
    31  }
    32  

View as plain text