Documentation ¶
Index ¶
- Constants
- Variables
- func AfterSuiteDB(db dynamolib.DynamoDBWrapper)
- func AfterSuiteRabbitMQ(conn *amqp091.Connection)
- func BeforeSuiteDB(testRegion string) dynamolib.DynamoDBWrapper
- func CreateAllTables(db dynamolib.DynamoDBWrapper)
- func DecodeJSON[T any](jsonBody io.Reader) T
- func DecodeJSONError(jsonBody io.Reader) api_error.JSONAPIError
- func DeleteAllTables(db dynamolib.DynamoDBWrapper)
- func DynamoConfig(region string) config.LocalDynamo
- func EnsureUser(db dynamolib.DynamoDBWrapper, u User)
- func EnsureUsers(db dynamolib.DynamoDBWrapper)
- func ExpectJSONEqualExceptLastSavedAt(a map[string]any, b map[string]any)
- func ExpectSuccess[T any](t T, err error) T
- func ExpectType[T any](thing any) T
- func LoadDemoSong() map[string]any
- func MakeRabbitMQConnection() *amqp091.Connection
- func MakeRabbitMQPublisher(conn *amqp091.Connection) *rabbitmq.QueuePublisher
- func MakeTestDB(testRegion string) dynamolib.DynamoDBWrapper
- func PrepareEchoContext(request *http.Request, response http.ResponseWriter) echo.Context
- func ResetDB(db dynamolib.DynamoDBWrapper)
- func ResetRabbitMQ(conn *amqp091.Connection)
- func ServerConfig(dbRegion string) server_app.Config
- func ServerEndpoint(path string) string
- func SetTestEnv()
- func TokenForUserID(userID string) string
- func WorkerConfig(dbRegion string, cloudStorageConfig config.LocalCloudStorage) worker_app.Config
- type RabbitMQConsumer
- type ReceivedMessage
- type RequestFactory
- type RequestModifier
- type RequestModifiers
- type User
- type Validator
Constants ¶
View Source
const ( DynamoAccessKeyID = dev.DynamoAccessKeyID DynamoSecretAccessKey = dev.DynamoSecretAccessKey DynamoDBHost = dev.DynamoDBHost )
DynamoDB
View Source
const ( RabbitMQHost = dev.RabbitMQHost RabbitMQQueueName = "chord-paper-tracks-test" )
RabbitMQ
View Source
const ( SongsTable = "Songs" UsersTable = "Users" TrackListsTable = "TrackLists" )
View Source
const (
ServerPort = ":5010"
)
Server
Variables ¶
View Source
var ( // in the system, is Google validated, and owner of songs and tracklists PrimaryUser = User{ ID: "primary-user-id", Name: "Primary User Name", Email: "primary@chordpaper.com", } // in the system, is Google validated, but not owner of songs and tracklists OtherUser = User{ ID: "other-user-id", Name: "Other User Name", Email: "other@chordpaper.com", } // is Google validated but not in the system NoAccountUser = User{ ID: "not-in-db-id", Name: "Not In DB User", Email: "adude@someoneelse.com", } GoogleUnauthorizedUser = User{ ID: "google-unauthorized-user-id", Name: "Google Unauthorized User", Email: "rando@notpaper.com", } )
Functions ¶
func AfterSuiteDB ¶
func AfterSuiteDB(db dynamolib.DynamoDBWrapper)
func AfterSuiteRabbitMQ ¶
func AfterSuiteRabbitMQ(conn *amqp091.Connection)
func BeforeSuiteDB ¶
func BeforeSuiteDB(testRegion string) dynamolib.DynamoDBWrapper
func CreateAllTables ¶
func CreateAllTables(db dynamolib.DynamoDBWrapper)
func DecodeJSON ¶
func DecodeJSONError ¶
func DecodeJSONError(jsonBody io.Reader) api_error.JSONAPIError
func DeleteAllTables ¶
func DeleteAllTables(db dynamolib.DynamoDBWrapper)
func DynamoConfig ¶
func DynamoConfig(region string) config.LocalDynamo
func EnsureUser ¶
func EnsureUser(db dynamolib.DynamoDBWrapper, u User)
func EnsureUsers ¶
func EnsureUsers(db dynamolib.DynamoDBWrapper)
func ExpectJSONEqualExceptLastSavedAt ¶
compare most of the fields, except last saved at
func ExpectSuccess ¶
func ExpectType ¶
func LoadDemoSong ¶
func MakeRabbitMQConnection ¶
func MakeRabbitMQConnection() *amqp091.Connection
func MakeRabbitMQPublisher ¶
func MakeRabbitMQPublisher(conn *amqp091.Connection) *rabbitmq.QueuePublisher
func MakeTestDB ¶
func MakeTestDB(testRegion string) dynamolib.DynamoDBWrapper
func PrepareEchoContext ¶
func PrepareEchoContext(request *http.Request, response http.ResponseWriter) echo.Context
func ResetRabbitMQ ¶
func ResetRabbitMQ(conn *amqp091.Connection)
func ServerConfig ¶
func ServerConfig(dbRegion string) server_app.Config
func ServerEndpoint ¶
func SetTestEnv ¶
func SetTestEnv()
func TokenForUserID ¶
func WorkerConfig ¶
func WorkerConfig(dbRegion string, cloudStorageConfig config.LocalCloudStorage) worker_app.Config
Types ¶
type RabbitMQConsumer ¶
type RabbitMQConsumer struct {
// contains filtered or unexported fields
}
func NewRabbitMQConsumer ¶
func NewRabbitMQConsumer(conn *amqp091.Connection) RabbitMQConsumer
func (*RabbitMQConsumer) AsyncStart ¶
func (r *RabbitMQConsumer) AsyncStart()
func (*RabbitMQConsumer) Stop ¶
func (r *RabbitMQConsumer) Stop()
func (*RabbitMQConsumer) Unload ¶
func (r *RabbitMQConsumer) Unload() ([]ReceivedMessage, error)
type ReceivedMessage ¶
type RequestFactory ¶
type RequestFactory struct { Method string Target string JSONObj any Mods RequestModifiers }
func (RequestFactory) MakeFake ¶
func (r RequestFactory) MakeFake() *http.Request
type RequestModifier ¶
func WithAuthHeader ¶
func WithAuthHeader(header string) RequestModifier
func WithUserCred ¶
func WithUserCred(user User) RequestModifier
type RequestModifiers ¶
type RequestModifiers []RequestModifier
func (*RequestModifiers) Add ¶
func (r *RequestModifiers) Add(mods ...RequestModifier)
Click to show internal directories.
Click to hide internal directories.