...

Package store

import "go.formulabun.club/replays/store"
Overview
Index

Overview ▾

Variables

var DuplicateEntryError = mysql.MySQLError{1062, [5]byte{}, ""}

func ConvertToStoreData

func ConvertToStoreData(replay replay.ReplayRaw) (r Replay, files []ReplayFile, err error)

type Client

type Client struct {
    *sql.DB
}

func NewClient

func NewClient() (Client, error)

func (*Client) FindReplay

func (db *Client) FindReplay(r Replay) ([]Replay, error)

func (*Client) GetReplayById

func (db *Client) GetReplayById(id int64) (result Replay, err error)

func (*Client) InsertReplayInfo

func (db *Client) InsertReplayInfo(replay Replay, files []ReplayFile) (id int64, err error)

func (*Client) InsertReplayRaw

func (db *Client) InsertReplayRaw(replay replay.ReplayRaw) (id int64, err error)

type Replay

type Replay struct {
    ReplayID    int64
    GameMap     uint16
    Time        uint32
    BestLap     uint32
    PlayerName  [16]byte
    PlayerSkin  [16]byte
    PlayerColor [16]byte
    Speed       byte
    Weight      byte
}

func (Replay) String

func (r Replay) String() string

type ReplayFile

type ReplayFile struct {
    FileName     string
    FileCheckSum [16]byte
}