util

package
v0.0.0-...-0cfe7c7 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIDFromURL

func GetIDFromURL(url string) string

GetIDFromURL returns the ID from the essay URL path.

func Log

func Log(key string, value interface{})

Log provides a basic wrapper to format log output.

func SendResponse

func SendResponse(statusCode int, payload interface{}, message string) (events.APIGatewayProxyResponse, error)

SendResponse is a helper function for sendin g responses to API Gateway.

func ValidateToken

func ValidateToken(tokenValue, signingKey string) error

ValidateToken evaluates the JWT received by the API.

Types

type AWS

type AWS struct {
	DynamoDB DynamoDB `json:"dynamodb"`
	S3       S3       `json:"s3"`
}

AWS represents aws config.json file field.

type Config

type Config struct {
	AWS    AWS    `json:"aws"`
	OpenAI OpenAI `json:"open_ai"`
}

Config represents the config.json file.

type DynamoDB

type DynamoDB struct {
	QuestionsTableName string `json:"questions_table_name"`
	SummariesTableName string `json:"summaries_table_name"`
}

DynamoDB represents dynamodb config.json file field.

type OpenAI

type OpenAI struct {
	APIKey string `json:"api_key"`
}

OpenAI represents openai config.json file field.

type S3

type S3 struct {
	DataBucketName string `json:"data_bucket_name"`
}

S3 represents s3 config.json file field.

Jump to

Keyboard shortcuts

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