events

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserIDRequired    = errors.New("UserID cannot be empty")    //nolint
	ErrEventTypeRequired = errors.New("EventType cannot be empty") //nolint
)

errors

Functions

func Configure

func Configure(api *operations.ClaAPI, service Service)

Configure setups handlers on api with service

Types

type Event

type Event struct {
	EventID        string `dynamodbav:"event_id"`
	EventType      string `dynamodbav:"event_type"`
	UserID         string `dynamodbav:"user_id"`
	EventProjectID string `dynamodbav:"event_project_id"`
	EventCompanyID string `dynamodbav:"event_company_id"`
	EventTime      string `dynamodbav:"event_time"`
	EventData      string `dynamodbav:"event_data"`
}

Event data model

type Repository

type Repository interface {
	CreateEvent(event *models.Event) error
	SearchEvents(ctx context.Context, params *events.SearchEventsParams) (*models.EventList, error)
}

Repository interface defines methods of event repository service

func NewRepository

func NewRepository(awsSession *session.Session, stage string) Repository

NewRepository creates a new instance of the event service

type Service

type Service interface {
	CreateEvent(event models.Event) error
	SearchEvents(ctx context.Context, params *events.SearchEventsParams) (*models.EventList, error)
}

Service interface defines methods of event service

func NewService

func NewService(repo Repository) Service

NewService creates new instance of event service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL