shift

package
v0.0.0-...-9349557 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HOME        = "https://shift.gearboxsoftware.com/home"
	SESSIONS    = "https://shift.gearboxsoftware.com/sessions"
	REWARDS     = "https://shift.gearboxsoftware.com/rewards"
	ENTITLEMENT = "https://shift.gearboxsoftware.com/entitlement_offer_codes"
	REDEMPTIONS = "https://shift.gearboxsoftware.com/code_redemptions"
)
View Source
const (
	ALREADY_REDEEMED = "This SHiFT code has already been redeemed"
	NOT_EXIST        = "This SHiFT code does not exist"
	EXPIRED          = "This SHiFT code has expired"
	SUCCESS          = "Your code was successfully redeemed"
	LINK2K           = "To redeem this SHiFT code, please link your 2K account."
)
View Source
const (
	VaultHunterSkinSuffix = "% Vault Hunter Skin"
	GoldenKey             = "Golden Key for Borderlands 4"
)

Variables

View Source
var CodeLength = 29
View Source
var CodeRegex = regexp.MustCompile("^(?:[A-Z0-9]{5}-){4}[A-Z0-9]{5}$")
View Source
var GearboxURL = &url.URL{
	Scheme: "https",
	Host:   "shift.gearboxsoftware.com",
}

Functions

func ParseRequiredCookies

func ParseRequiredCookies(cookies []string) []*http.Cookie

func ToPretty

func ToPretty(p Platform) string

func ValidGame

func ValidGame(g string) bool

Types

type Client

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

func NewClient

func NewClient(cookies []*http.Cookie) (*Client, error)

func (*Client) CheckRewards

func (client *Client) CheckRewards(platform Platform, game Game, limit int) ([]Reward, error)

func (*Client) DumpCookies

func (client *Client) DumpCookies() []*http.Cookie

func (*Client) Login

func (client *Client) Login(email string, password string) error

func (*Client) RedeemCode

func (client *Client) RedeemCode(code string, platform Platform) (string, error)

type Game

type Game string
const (
	Borderlands4 Game = "Borderlands 4"
)

type Platform

type Platform string
const (
	Total    Platform = "total"
	Steam    Platform = "steam"
	Epic     Platform = "epic"
	XboxLive Platform = "xboxlive"
	PSN      Platform = "psn"
)

type ResponseType

type ResponseType int
const (
	Success ResponseType = iota
	AlreadyRedeemed
	Invalid
	Expired
	Link2KAccount
	Unrecognized
)

func DetermineResponseType

func DetermineResponseType(input string) ResponseType

type Reward

type Reward struct {
	Title       string
	Date        string // UTC time? - 8:00+PST redemption was after midnight because it displayed the next day
	Description string
}

Jump to

Keyboard shortcuts

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