util

package
v0.0.0-...-5888283 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ContentTypeJSON = "application/json"
View Source
const NBAR2Bucket = "nba"

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

func NBAGameStatusNameMappings

func NBAGameStatusNameMappings() map[nba.GameStatus]string

func NBASeasonStageNameMappings

func NBASeasonStageNameMappings() map[int]SeasonStage

func WriteJSON

func WriteJSON(statusCode int, obj interface{}, w http.ResponseWriter)

Types

type FileOutputWriter

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

func WithFileOutputWriter

func WithFileOutputWriter(logger *slog.Logger, filepath string) FileOutputWriter

func (FileOutputWriter) Put

func (f FileOutputWriter) Put(ctx context.Context, b []byte) error

type R2OutputWriter

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

func WithR2OutputWriter

func WithR2OutputWriter(
	logger *slog.Logger,
	r2Client cloudflare.Client,
	bucket string,
	objectKey string,
) R2OutputWriter

func (R2OutputWriter) Put

func (r R2OutputWriter) Put(ctx context.Context, b []byte) error

type RetryableLogger

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

func (RetryableLogger) Debug

func (r RetryableLogger) Debug(msg string, keysAndValues ...interface{})

func (RetryableLogger) Error

func (r RetryableLogger) Error(msg string, keysAndValues ...interface{})

func (RetryableLogger) Info

func (r RetryableLogger) Info(msg string, keysAndValues ...interface{})

func (RetryableLogger) Warn

func (r RetryableLogger) Warn(msg string, keysAndValues ...interface{})

type SeasonStage

type SeasonStage string
const (
	SeasonStagePre     SeasonStage = "pre"
	SeasonStageRegular SeasonStage = "regular"
	SeasonStageAllStar SeasonStage = "allstar"
	SeasonStagePost    SeasonStage = "post"
	SeasonStagePlayIn  SeasonStage = "playin"
)

func NBASeasonTypeToInternal

func NBASeasonTypeToInternal(nbaSeasonType nba.SeasonType) SeasonStage

Jump to

Keyboard shortcuts

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