model

package
v0.0.0-...-dab71c7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDType

type IDType uint64

IDType is the generic ID type.

type Project

type Project struct {
	Name  string `json:"name" db:"name"`
	Descr string `json:"descr" db:"descr"`
}

Project represents a project.

func ProjectFromProto

func ProjectFromProto(p *ttv1.Project) Project

ProjectFromProto returns Project corresponding to ttv1.Project

func (Project) Proto

func (p Project) Proto() *ttv1.Project

Proto returns proto representation.

type Snippet

type Snippet struct {
	ID       IDType `json:"id" db:"id"`
	Username string `json:"username" db:"username"`
	TS       int64  `json:"ts" db:"ts"`
	Contents string `json:"contents" db:"contents"`
}

Snippet is a short note that says what has been done on a given day.

func SnippetFromProto

func SnippetFromProto(s *ttv1.Snippet) Snippet

SnippetFromProto returns Snippet corresponding to ttv1.Snippet

func (Snippet) Proto

func (s Snippet) Proto() *ttv1.Snippet

Proto returns proto representation.

type User

type User struct {
	Username string `json:"username" db:"username"`
	Password string `json:"password" db:"password"`
	Email    string `json:"email" db:"email"`
	Phone    string `json:"phone" db:"phone"`
}

User represents a user.

func UserFromProto

func UserFromProto(u *ttv1.User) User

UserFromProto returns User corresponding to ttv1.User

func (User) Proto

func (u User) Proto() *ttv1.User

Proto returns proto representation.

func (*User) RemoveSensitive

func (u *User) RemoveSensitive()

Remove sensitive elements

func (*User) Validate

func (u *User) Validate() error

Validate user

type Work

type Work struct {
	ID       IDType `json:"id" db:"id"`
	Username string `json:"username" db:"username"`
	Project  string `json:"project" db:"project"`
	TS       int64  `json:"ts" db:"ts"`
	Duration int64  `json:"duration" db:"duration"`
	Descr    string `json:"descr" db:"descr"`
}

Work represents work that has been done on a project.

func WorkFromProto

func WorkFromProto(w *ttv1.Work) Work

WorkFromProto returns Work corresponding to ttv1.Work

func (Work) Proto

func (w Work) Proto() *ttv1.Work

Proto returns proto representation.

Jump to

Keyboard shortcuts

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