fs

package
v0.0.0-...-dc9cd0e Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2019 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

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

func Default

func Default(sec securityLayer) FS

func (FS) NoteCreate

func (fs FS) NoteCreate(ctx context.Context, user common.User, text string) (common.Note, error)

func (FS) NoteGetLatest

func (fs FS) NoteGetLatest(ctx context.Context, user common.User) (common.Note, error)

func (FS) NoteGetLatestWithTime

func (fs FS) NoteGetLatestWithTime(ctx context.Context, user common.User, t time.Duration) (common.Note, error)

func (FS) NoteGetList

func (fs FS) NoteGetList(ctx context.Context, user common.User, page, count int) ([]common.Note, bool, error)

func (FS) UserAll

func (fs FS) UserAll(ctx context.Context, user common.User) ([]common.Note, error)

func (FS) UserCreate

func (fs FS) UserCreate(ctx context.Context, username, plaintext, phone string) (common.User, error)

func (FS) UserDel

func (fs FS) UserDel(ctx context.Context, user common.User) error

func (FS) UserGet

func (fs FS) UserGet(ctx context.Context, token string) (common.User, error)

func (FS) UserGetByNumber

func (fs FS) UserGetByNumber(ctx context.Context, phone string) (common.User, error)

func (FS) UserGetByUsername

func (fs FS) UserGetByUsername(ctx context.Context, username string) (common.User, error)

func (FS) UserLogin

func (fs FS) UserLogin(ctx context.Context, username, plaintext string) (common.User, error)

type Note

type Note struct {
	NoteText      string
	NoteShort     string
	NoteCreatedAt int64

	// Relations:
	UserID string
	// contains filtered or unexported fields
}

func (Note) ID

func (Note Note) ID() string

func (Note) Short

func (Note Note) Short() string

func (Note) Text

func (Note Note) Text() string

func (Note) Token

func (Note Note) Token() string

type User

type User struct {
	UserUsername          string
	UserPhone             string
	UserEncryptedPassword string
	UserCreatedAt         int64
	// contains filtered or unexported fields
}

func (*User) ID

func (user *User) ID() string

func (*User) Phone

func (user *User) Phone() string

func (*User) Save

func (user *User) Save(ctx context.Context) error

func (*User) SetPass

func (user *User) SetPass(plaintext string)

func (*User) SetPhone

func (user *User) SetPhone(value string)

func (*User) SetUsername

func (user *User) SetUsername(value string)

func (*User) Token

func (user *User) Token() string

func (*User) Username

func (user *User) Username() string

Jump to

Keyboard shortcuts

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