movie

package
v0.0.0-...-4622058 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SomeSharedEnvVar string `envconfig:"SOME_SHARED_ENV_VAR"`
	SomeFxnEnvVar    int    `envconfig:"SOME_FXN_ENV_VAR"`

	ProcessMovieQueueUrl string `envconfig:"PROCESS_MOVIE_QUEUE_URL"`
}

func NewConfig

func NewConfig() *Config

type Database

type Database struct{}

func NewDatabase

func NewDatabase() *Database

func (*Database) CreateMovie

func (db *Database) CreateMovie(movie Movie) (*Movie, error)

func (*Database) GetMovie

func (db *Database) GetMovie(id uuid.UUID) (*Movie, error)

type Movie

type Movie struct {
	Id       uuid.UUID `json:"id"`
	Title    string    `json:"title"`
	Director string    `json:"director"`
	Year     int       `json:"year"`
}

type ProcessMovieQueuer

type ProcessMovieQueuer interface {
	SendMovieForProcessing(movie Movie) error
}

type Repository

type Repository interface {
	CreateMovie(movie Movie) (*Movie, error)
	GetMovie(id uuid.UUID) (*Movie, error)
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(sharedEnvVar string, db Repository, sqsClient ProcessMovieQueuer) *Service

func (*Service) CreateMovie

func (s *Service) CreateMovie(movie Movie) (*Movie, error)

func (*Service) GetMovie

func (s *Service) GetMovie(id uuid.UUID) (*Movie, error)

func (*Service) ProcessMovie

func (s *Service) ProcessMovie(movie Movie) error

type SqsClient

type SqsClient struct {
	*sqs.SQS
	// contains filtered or unexported fields
}

func NewSqsClient

func NewSqsClient(processMovieQueueUrl string) *SqsClient

func (*SqsClient) SendMovieForProcessing

func (c *SqsClient) SendMovieForProcessing(movie Movie) error

Jump to

Keyboard shortcuts

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