controller

package
v0.0.0-...-7be19fd Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetRedis

func SetRedis(redis Redis)

Types

type Controller

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

func Instance

func Instance() *Controller

func (Controller) GetNonCachedDuration

func (c Controller) GetNonCachedDuration(username string) (time.Duration, error)

func (Controller) GetRepo

func (c Controller) GetRepo(username string) (*Repo, error)

func (Controller) SetNonCachedDuration

func (c Controller) SetNonCachedDuration(username string, duration time.Duration) error

type Redis

type Redis interface {
	Set(key, value string, expire time.Duration) error
	Get(key string) (string, error)
}

type Repo

type Repo struct {
	Username string        `json:"username"`
	Repos    int           `json:"repos"`
	Cached   bool          `json:"cached"`
	Duration time.Duration `json:"duration"`
	Faster   int           `json:"faster"`
}

Jump to

Keyboard shortcuts

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