types

package
v0.0.0-...-116c032 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppUrl

func AppUrl() string

func Id

func Id() uint64

func UniqueId

func UniqueId() (uint64, error)

Types

type Context

type Context struct {

	// Sender's UserId as string.
	AsUser Uid
	// contains filtered or unexported fields
}

func (*Context) Cancel

func (c *Context) Cancel() context.CancelFunc

func (*Context) Context

func (c *Context) Context() context.Context

func (*Context) SetTimeout

func (c *Context) SetTimeout(timeout time.Duration)

type FileDef

type FileDef struct {
	ObjHeader `bson:",inline"`
	// Name of the file
	Name string
	// Status of upload
	Status int
	// User who created the file
	User string
	// Type of the file.
	MimeType string
	// Size of the file in bytes.
	Size int64
	// Internal file location, i.e. path on disk or an S3 blob address.
	Location string
}

FileDef is a stored record of a file upload

func (*FileDef) Uid

func (i *FileDef) Uid() Uid

type ID

type ID string

func Uint64ID

func Uint64ID(u uint64) ID

func (ID) Uint64

func (id ID) Uint64() uint64

type KV

type KV map[string]interface{}

func (KV) Any

func (j KV) Any(key string) (any, bool)

func (KV) Float64

func (j KV) Float64(key string) (float64, bool)

func (KV) Float64Value

func (j KV) Float64Value() (float64, bool)

func (KV) Int64

func (j KV) Int64(key string) (int64, bool)

func (KV) Int64Value

func (j KV) Int64Value() (int64, bool)

func (KV) List

func (j KV) List(key string) ([]any, bool)

func (KV) Map

func (j KV) Map(key string) (map[string]interface{}, bool)

func (KV) Merge

func (j KV) Merge(kvs ...KV) KV

func (*KV) Scan

func (j *KV) Scan(value interface{}) error

func (KV) String

func (j KV) String(key string) (string, bool)

func (KV) StringValue

func (j KV) StringValue() (string, bool)

func (KV) Uint64

func (j KV) Uint64(key string) (uint64, bool)

func (KV) Uint64Value

func (j KV) Uint64Value() (uint64, bool)

func (KV) Value

func (j KV) Value() (driver.Value, error)

type ObjHeader

type ObjHeader struct {
	// using string to get around rethinkdb's problems with uint64;
	// `bson:"_id"` tag is for mongodb to use as primary key '_id'.
	Id string `bson:"_id"`
	//id        Uid
	CreatedAt time.Time
	UpdatedAt time.Time
}

ObjHeader is the header shared by all stored objects.

type Uid

type Uid string

Uid is a database-specific record id, suitable to be used as a primary key.

const ZeroUid Uid = ""

ZeroUid is a constant representing uninitialized Uid.

func (Uid) IsZero

func (uid Uid) IsZero() bool

IsZero checks if Uid is uninitialized.

func (Uid) String

func (uid Uid) String() string

stringer implements fmt.Stringer interface.

type UserLoginRequest

type UserLoginRequest struct {
	Username string `json:"username" validate:"required"` // Account name
	Password string `json:"password" validate:"required"` // Password
}

type UserLoginResponse

type UserLoginResponse struct {
	ID    ID     `json:"id"`    // Account ID
	Token string `json:"token"` // JWT token
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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