services

package module
v0.0.0-...-d7b0689 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToSocialList

func AddToSocialList(appCtx AppCtx, owner common.AccountId, listType SocialListType, idToAdd common.AccountId) error

func Auth

func Auth(appCtx AppCtx, username string, password string, ip net.IP, port int32) (common.AccountId, error)

func CreateAccount

func CreateAccount(app AppCtx, username string, password string) (common.AccountId, error)

func GetSocialList

func GetSocialList(appCtx AppCtx, owner common.AccountId, listType SocialListType) ([]common.AccountId, error)

func GetUserContacts

func GetUserContacts(appCtx AppCtx, accountIDs []common.AccountId) ([]common.Contact, error)

func HashPassword

func HashPassword(password string) (string, error)

func RemoveFromSocialList

func RemoveFromSocialList(appCtx AppCtx, owner common.AccountId, listType string, idToRemove common.AccountId) error

func UpdateUserContact

func UpdateUserContact(appCtx AppCtx, accountId common.AccountId, ip net.IP, port int32) error

Types

type AppCtx

type AppCtx struct {
	Server *grpc.Server
	// contains filtered or unexported fields
}

func NewAppCtx

func NewAppCtx(l zerolog.Logger, s *grpc.Server, db *sql.DB, addr common.Address) AppCtx

func (AppCtx) GetAddr

func (a AppCtx) GetAddr() common.Address

func (AppCtx) Log

func (a AppCtx) Log(f string) zerolog.Logger

type SocialListType

type SocialListType string
const (
	SocialListType_BLOCKED   SocialListType = "BLOCKED"
	SocialListType_FOLLOWS   SocialListType = "FOLLOWS"
	SocialListType_FOLLOWING SocialListType = "FOLLOWING"
)

Jump to

Keyboard shortcuts

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