devpost

package
v0.0.0-...-e5d03f5 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package devpost fetches the hackathon projects from devpost.com

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	io.Closer
	FetchProjects(ctx context.Context, eventID string) ([]*Project, error)
	FetchProject(ctx context.Context, p *Project) error
}

func New

func NewCached

func NewCached(parentCtx context.Context, d Client, freshness, autoRefresh time.Duration, cacheFilePath string) (Client, error)

type Event

type Event struct {
	ID            string     `json:"id"`
	Projects      []*Project `json:"projects"`
	LastRefresh   time.Time  `json:"last_refresh,omitzero"`
	LastRequested time.Time  `json:"last_requested,omitzero"`
}

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       []byte
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type Person

type Person struct {
	Name      string `json:"name"`
	URL       string `json:"url"`
	AvatarURL string `json:"avatar_url"`
}

type Project

type Project struct {
	ID        string   `json:"id"`
	ShortName string   `json:"short_name"`
	Title     string   `json:"title"`
	URL       string   `json:"url"`
	Tagline   string   `json:"tagline"`
	Image     string   `json:"image"`
	Winner    bool     `json:"winner"`
	Team      []Person `json:"team"`
	Likes     int      `json:"likes"`

	// These are loaded by fetchProject:
	Description   string   `json:"description"`
	DescriptionMD string   `json:"description_md"`
	Tags          []string `json:"tags"`

	LastRefresh time.Time `json:"last_refresh,omitzero"`
}

func (*Project) Hash

func (p *Project) Hash() string

Jump to

Keyboard shortcuts

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