database

package
v0.0.0-...-c9f28b2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func New

func New(ctx *context.Context) (*Database, error)

func (*Database) Close

func (c *Database) Close()

func (*Database) Delete

func (c *Database) Delete(key *datastore.Key) error

func (*Database) DeleteMulti

func (c *Database) DeleteMulti(key []*datastore.Key) error

func (*Database) Get

func (c *Database) Get(key *datastore.Key, entity interface{}) error

func (*Database) GetAll

func (c *Database) GetAll(query *datastore.Query, entities interface{}) ([]*datastore.Key, error)

func (*Database) Put

func (c *Database) Put(key *datastore.Key, entry interface{}) error

type Log

type Log struct {
	Id   string    `datastore:"id" json:"id"`
	Date time.Time `datastore:"date" json:"date"`

	// キャンパス
	// 千住 or 鳩山
	Campus string `datastore:"campus" json:"campus"`

	//ログ定期
	// 詳しくはlogcation/webのソース参照: https://github.com/tdu-logcation/web/blob/0d9feacdd50c5edfc1c28ab5a4510a3370715173/%40types/log.ts#L9-L11
	LogType string `datastore:"log_type" json:"log_type"`

	// ログのラベル
	Label string `datastore:"label" json:"label"`

	// ログデータ
	Code string `datastore:"code" json:"code"`
}

type Rank

type Rank struct {
	Name         string `json:"name"`
	NumberOfLogs int    `json:"number_of_logs"`
}

type Ranks

type Ranks []Rank

func (Ranks) Len

func (r Ranks) Len() int

func (Ranks) Less

func (r Ranks) Less(i, j int) bool

func (Ranks) Swap

func (r Ranks) Swap(i, j int)

type User

type User struct {
	Id string `datastore:"id" json:"id"`

	// ユーザ名
	Name         string    `datastore:"name" json:"name"`
	CreateDate   time.Time `datastore:"create_date" json:"create_date"`
	NumberOfLogs int       `datastore:"number_of_logs" json:"number_of_logs"`
}

type Users

type Users []User

func (Users) Len

func (u Users) Len() int

func (Users) Less

func (u Users) Less(i, j int) bool

func (Users) Swap

func (u Users) Swap(i, j int)

Jump to

Keyboard shortcuts

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