Documentation
¶
Index ¶
- func AttachmentIDFromFileName(fileName string) (int64, error)
- type Attachment
- type CreateAttachmentRequest
- type CreateEnvelopeRequest
- type DataStore
- type Envelope
- type EnvelopeService
- func (es *EnvelopeService) CreateEnvelope(ctx context.Context, req *CreateEnvelopeRequest) (int64, error)
- func (es *EnvelopeService) DeleteEnvelope(ctx context.Context, msgID int64) error
- func (es *EnvelopeService) GetData(ctx context.Context, att *Attachment) ([]byte, error)
- func (es *EnvelopeService) GetDataSize(ctx context.Context) (int64, error)
- func (es *EnvelopeService) GetEnvelope(ctx context.Context, msgID int64) (*Envelope, error)
- func (es *EnvelopeService) ListAttachment(ctx context.Context, page *paginate.Page) ([]Attachment, error)
- func (es *EnvelopeService) ListEnvelope(ctx context.Context, page *paginate.Page) ([]Envelope, error)
- type LocalDataStore
- type Message
- type Service
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attachment ¶
func NewAttachment ¶
func NewAttachment(name string, data []byte) *Attachment
func (*Attachment) FileName ¶
func (a *Attachment) FileName() string
func (*Attachment) IsImage ¶
func (a *Attachment) IsImage() bool
type CreateAttachmentRequest ¶
type CreateEnvelopeRequest ¶
type Envelope ¶
type Envelope struct {
Message Message
Attachments []Attachment
}
type EnvelopeService ¶
type EnvelopeService struct {
// contains filtered or unexported fields
}
func NewEnvelopeService ¶
func NewEnvelopeService(store Store, dataStore DataStore) *EnvelopeService
func (*EnvelopeService) CreateEnvelope ¶
func (es *EnvelopeService) CreateEnvelope(ctx context.Context, req *CreateEnvelopeRequest) (int64, error)
func (*EnvelopeService) DeleteEnvelope ¶
func (es *EnvelopeService) DeleteEnvelope(ctx context.Context, msgID int64) error
func (*EnvelopeService) GetData ¶
func (es *EnvelopeService) GetData(ctx context.Context, att *Attachment) ([]byte, error)
func (*EnvelopeService) GetDataSize ¶
func (es *EnvelopeService) GetDataSize(ctx context.Context) (int64, error)
func (*EnvelopeService) GetEnvelope ¶
func (*EnvelopeService) ListAttachment ¶
func (es *EnvelopeService) ListAttachment(ctx context.Context, page *paginate.Page) ([]Attachment, error)
func (*EnvelopeService) ListEnvelope ¶
type LocalDataStore ¶
type Message ¶
type Service ¶
type Service interface {
ListAttachment(ctx context.Context, page *paginate.Page) ([]Attachment, error)
ListEnvelope(ctx context.Context, page *paginate.Page) ([]Envelope, error)
GetEnvelope(ctx context.Context, msgID int64) (*Envelope, error)
CreateEnvelope(ctx context.Context, req *CreateEnvelopeRequest) (int64, error)
DeleteEnvelope(ctx context.Context, msgID int64) error
GetData(ctx context.Context, att *Attachment) ([]byte, error)
GetDataSize(ctx context.Context) (int64, error)
}
type Store ¶
type Store interface {
CountAttachment(ctx context.Context) (int, error)
ListAttachment(ctx context.Context, offset, limit int, ascending bool) ([]Attachment, int, error)
ListEnvelope(ctx context.Context, offset, limit int, ascending bool) ([]Envelope, int, error)
CreateEnvelope(ctx context.Context, msg *Message, atts []Attachment) (int64, error)
CountEnvelope(ctx context.Context) (int, error)
GetEnvelope(ctx context.Context, msgID int64) (*Envelope, error)
DeleteEnvelope(ctx context.Context, msgID int64, fn func(env *Envelope) error) error
}
Click to show internal directories.
Click to hide internal directories.