Documentation
¶
Index ¶
- func AddNumberAttribute(item map[string]*dynamodb.AttributeValue, key string, value int64)
- func AddStringAttribute(item map[string]*dynamodb.AttributeValue, key string, value string)
- func CreateEventWrapper(eventType string) *event.Event
- func CurrentTime() (time.Time, string)
- func DeleteFromS3(filename string) error
- func DownloadFromS3(filename string) ([]byte, error)
- func FmtDuration(d time.Duration) string
- func SendEmail(subject string, body string, recipients []string) error
- func SetEmailSender(es EmailSender)
- func SetS3Storage(awsSession *session.Session, bucketName string)
- func SetSnsEmailSender(awsSession *session.Session, snsEventTopicARN string, ...)
- func TimeToString(t time.Time) string
- func ToEmailEvent(sender *string, recipients []string, subject *string, emailBody *string) *emailevent.EmailEvent
- func UploadToS3(body []byte, projectID string, claType string, identifier string, ...) error
- type EmailSender
- type S3Client
- type S3Storage
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNumberAttribute ¶ added in v1.0.11
func AddNumberAttribute(item map[string]*dynamodb.AttributeValue, key string, value int64)
AddNumberAttribute adds number attribute to dynamodb input map
func AddStringAttribute ¶ added in v1.0.11
func AddStringAttribute(item map[string]*dynamodb.AttributeValue, key string, value string)
AddStringAttribute adds string attribute to dynamodb input map
func CreateEventWrapper ¶
CreateEventWrapper creates a new event with the specified event type
func CurrentTime ¶ added in v1.0.11
CurrentTime returns the current UTC time and current Time in the RFC3339 format
func DeleteFromS3 ¶ added in v1.0.11
DeleteFromS3 deletes file from s3
func DownloadFromS3 ¶ added in v1.0.11
DownloadFromS3 downloads file from s3
func FmtDuration ¶
FmtDuration is a helper function to format a duration in the HH:MM:SS.sss format
func SetEmailSender ¶ added in v1.0.8
func SetEmailSender(es EmailSender)
SetEmailSender sets up default email sender
func SetS3Storage ¶ added in v1.0.11
SetS3Storage set default S3Storage
func SetSnsEmailSender ¶ added in v1.0.8
func SetSnsEmailSender(awsSession *session.Session, snsEventTopicARN string, senderEmailAddress string)
SetSnsEmailSender set sns as mechanism to send email
func TimeToString ¶ added in v1.0.11
TimeToString returns time in the RFC3339 format
func ToEmailEvent ¶
func ToEmailEvent(sender *string, recipients []string, subject *string, emailBody *string) *emailevent.EmailEvent
ToEmailEvent converts an organization model into a create org event model
func UploadToS3 ¶ added in v1.0.11
func UploadToS3(body []byte, projectID string, claType string, identifier string, signatureID string) error
UploadToS3 uploads file to s3 storage at path contract-group/<project-ID>/<claType>/<identifier>/<signatureID>.pdf claType should be cla or ccla identifier can be user-id or company-id
Types ¶
type EmailSender ¶ added in v1.0.8
EmailSender contains method to send email
type S3Client ¶ added in v1.0.11
type S3Client struct {
BucketName string
// contains filtered or unexported fields
}
S3Client struct provide methods to interact with s3
func (*S3Client) Upload ¶ added in v1.0.11
func (s3c *S3Client) Upload(fileContent []byte, projectID string, claType string, identifier string, signatureID string) error
Upload file to s3 storage at path contract-group/<project-ID>/<claType>/<identifier>/<signatureID>.pdf claType should be cla or ccla identifier can be user-id or company-id
type S3Storage ¶ added in v1.0.11
type S3Storage interface {
Upload(fileContent []byte, projectID string, claType string, identifier string, signatureID string) error
Download(filename string) ([]byte, error)
Delete(filename string) error
}
S3Storage provides methods to handle s3 storage
type Service ¶ added in v1.0.8
type Service interface {
}
Service interface defines methods of event service
func NewService ¶ added in v1.0.8
func NewService() Service
NewService creates new instance of event service