data

package
v0.0.0-...-a41176a Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CategoryName

type CategoryName string

type CategoryUUID

type CategoryUUID string

type Connection

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

func NewConnection

func NewConnection(log *zap.Logger, config *cfg.ConfigDatabasePostgres, secret *cfg.SecretDatabasePostgres) (*Connection, error)

func (Connection) AvatarRead128

func (conn Connection) AvatarRead128(userUUID UserUUID, dest *Raw) error

func (Connection) AvatarRead256

func (conn Connection) AvatarRead256(userUUID UserUUID, dest *Raw) error

func (Connection) AvatarRead512

func (conn Connection) AvatarRead512(userUUID UserUUID, dest *Raw) error

func (Connection) AvatarSet

func (conn Connection) AvatarSet(update bool, userUUID UserUUID, avatars UserAvatars) error

func (Connection) CredentialsCreate

func (conn Connection) CredentialsCreate(userUUID UserUUID, hLogin HashedLogin, hPassword HashedPassword) error

func (Connection) CredentialsDelete

func (conn Connection) CredentialsDelete(userUUID UserUUID) error

func (Connection) CredentialsRead

func (conn Connection) CredentialsRead(hLogin HashedLogin, hPassword HashedPassword, userUUID *UserUUID) error

func (Connection) PostCreate

func (conn Connection) PostCreate(container Post) error

func (Connection) SessionCreate

func (conn Connection) SessionCreate(uid UserUUID, sid SessionUUID, key SessionKey, valid time.Time) error

func (Connection) SessionDeleteKey

func (conn Connection) SessionDeleteKey(key SessionKey) error

func (Connection) SessionRead

func (conn Connection) SessionRead(key SessionKey) (*UserUUID, *time.Time, error)

func (Connection) ThreadCreate

func (conn Connection) ThreadCreate(userUUID UserUUID, categoryUUID CategoryUUID, name ThreadName, header ThreadHeader) error

func (Connection) ThreadDelete

func (conn Connection) ThreadDelete(threadUUID string) error

func (Connection) ThreadGet

func (conn Connection) ThreadGet(threadUUID ThreadUUID, container *ViewThread) error

func (Connection) ThreadGetList

func (conn Connection) ThreadGetList(categoryUUID string, container *ViewThreadsByCategory) error

func (Connection) ThreadUpdate

func (conn Connection) ThreadUpdate(threadUUID string, container ViewThreadUpdate) error

func (Connection) UserGet

func (conn Connection) UserGet(uuid UserUUID, container *ViewUserFull) error

func (Connection) UserSet

func (conn Connection) UserSet(uuid UserUUID, name *UserFullName, nick *UserNickName) error

type CreateThread

type CreateThread struct {
	ThreadUUID
	CategoryUUID
	UserUUID
	ThreadName
	DateAdded    Date
	DateLastEdit Date
	ThreadHeader
}

type Date

type Date int64

type HashedLogin

type HashedLogin []byte

func (HashedLogin) Verify

func (s HashedLogin) Verify() bool

type HashedPassword

type HashedPassword []byte

func (HashedPassword) Verify

func (s HashedPassword) Verify() bool

type Logger

type Logger struct {
	*zap.Logger
}

func (Logger) Log

func (s Logger) Log(_ context.Context, level pgx.LogLevel, msg string, data map[string]interface{})

type ModelCategory

type ModelCategory struct {
	CategoryUUID
	CategoryName
}

type Post

type Post struct {
	UserUUID
	Date
	PostContent
}

type PostContent

type PostContent string

type PostUUID

type PostUUID string

type Raw

type Raw []byte

func (Raw) Bytes

func (r Raw) Bytes() []byte

type SessionKey

type SessionKey string

func (SessionKey) Verify

func (s SessionKey) Verify() bool

type SessionUUID

type SessionUUID string

func (SessionUUID) Verify

func (s SessionUUID) Verify() bool

type ThreadHeader

type ThreadHeader string

type ThreadName

type ThreadName string

type ThreadUUID

type ThreadUUID string

type URLUserAvatar128

type URLUserAvatar128 url.URL

type URLUserAvatar256

type URLUserAvatar256 url.URL

type URLUserAvatar512

type URLUserAvatar512 url.URL

type UserAvatars

type UserAvatars struct {
	Avatar128 Raw
	Avatar256 Raw
	Avatar512 Raw
}

type UserFullName

type UserFullName string

func (UserFullName) Verify

func (u UserFullName) Verify() bool

type UserNickName

type UserNickName string

func (UserNickName) Verify

func (u UserNickName) Verify() bool

type UserPosts

type UserPosts uint32

type UserRegistrationDate

type UserRegistrationDate int64

type UserUUID

type UserUUID string

func (UserUUID) Verify

func (u UserUUID) Verify() bool

type Verifiable

type Verifiable interface {
	Verify() bool
}

type ViewPostByThreadUUID

type ViewPostByThreadUUID struct {
	PostUUID
	UserUUID
	DateAdded    Date
	DateLastEdit Date
	PostContent
}

type ViewThread

type ViewThread struct {
	Category     ModelCategory
	Author       ViewUserProfileFromThread
	Name         string
	DateAdded    int64
	DateLastEdit int64
	Header       string
	Content      ViewThreadContent
}

type ViewThreadContent

type ViewThreadContent struct {
	Users []ViewUserProfileFromThread
	Posts []ViewPostByThreadUUID
}

type ViewThreadUpdate

type ViewThreadUpdate struct {
	CategoryUUID *string
	Name         *string
	Header       *string
}

type ViewThreadsByCategory

type ViewThreadsByCategory struct {
	ThreadUUID
	ThreadName
}

type ViewUserFull

type ViewUserFull struct {
	UserNickName         `db:"nick_name"`
	UserFullName         `db:"full_name"`
	UserPosts            `db:"posts"`
	UserRegistrationDate `db:"registration_date"`
}

type ViewUserProfileFromThread

type ViewUserProfileFromThread struct {
	UserUUID
	RegistrationDate Date
	UserNickName
	UserFullName
}

Jump to

Keyboard shortcuts

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