iface

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 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 File

type File struct {
	ID         string    `json:"id"`
	TokenID    string    `json:"-"` // this data should NEVER be sent to the client !!!
	Sha256     string    `json:"hash"`
	Size       int64     `json:"size"`
	Name       string    `json:"name"`
	Mime       string    `json:"mime"`
	Expire     *NullTime `json:"expire"`
	UploadIP   string    `json:"-"`
	UploadTime time.Time `json:"uploadTime"`
}

type NullTime

type NullTime struct {
	Time  time.Time
	Valid bool // Valid is true if Time is not NULL
}

thanks to lib/pq !! https://github.com/lib/pq/blob/b269bd035a727d6c1081f76e7a239a1b00674c40/encode.go#L521

func (*NullTime) MarshalJSON

func (nt *NullTime) MarshalJSON() ([]byte, error)

support json.Marshal()

func (*NullTime) Scan

func (nt *NullTime) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullTime) Value

func (nt NullTime) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Token

type Token struct {
	ID      string `json:"id"`
	IsAdmin bool   `json:"isAdmin"`
}

Jump to

Keyboard shortcuts

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