shared

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GRPCClient

type GRPCClient struct {
	Client   proto.UserStorageClient
	Closable io.Closer
}

GRPCClient is an implementation of KV that talks over RPC.

func (GRPCClient) AddUserWithFederatedID

func (m GRPCClient) AddUserWithFederatedID(user model.User, provider string, id, role string) (model.User, error)

func (GRPCClient) AddUserWithPassword

func (m GRPCClient) AddUserWithPassword(user model.User, password, role string, isAnonymous bool) (model.User, error)

func (GRPCClient) AllDeviceTokens

func (m GRPCClient) AllDeviceTokens(userID string) ([]string, error)

func (GRPCClient) AttachDeviceToken

func (m GRPCClient) AttachDeviceToken(userID, token string) error

push device tokens

func (GRPCClient) CheckPassword

func (m GRPCClient) CheckPassword(id, password string) error

func (GRPCClient) Close

func (m GRPCClient) Close()

func (GRPCClient) DeleteUser

func (m GRPCClient) DeleteUser(id string) error

func (GRPCClient) DetachDeviceToken

func (m GRPCClient) DetachDeviceToken(token string) error

func (GRPCClient) FetchUsers

func (m GRPCClient) FetchUsers(search string, skip, limit int) ([]model.User, int, error)

func (GRPCClient) ImportJSON

func (m GRPCClient) ImportJSON(data []byte, clearOldData bool) error

import data

func (GRPCClient) ResetPassword

func (m GRPCClient) ResetPassword(id, password string) error

func (GRPCClient) UpdateLoginMetadata

func (m GRPCClient) UpdateLoginMetadata(userID string)

func (GRPCClient) UpdateUser

func (m GRPCClient) UpdateUser(userID string, newUser model.User) (model.User, error)

func (GRPCClient) UserByEmail

func (m GRPCClient) UserByEmail(email string) (model.User, error)

func (GRPCClient) UserByFederatedID

func (m GRPCClient) UserByFederatedID(provider string, id string) (model.User, error)

func (GRPCClient) UserByID

func (m GRPCClient) UserByID(id string) (model.User, error)

func (GRPCClient) UserByPhone

func (m GRPCClient) UserByPhone(phone string) (model.User, error)

func (GRPCClient) UserByUsername

func (m GRPCClient) UserByUsername(username string) (model.User, error)

type GRPCServer

type GRPCServer struct {
	// This is the real implementation
	Impl model.UserStorage
	proto.UnimplementedUserStorageServer
}

Here is the gRPC server that GRPCClient talks to.

func (*GRPCServer) AddUserWithFederatedID

func (m *GRPCServer) AddUserWithFederatedID(ctx context.Context, in *proto.AddUserWithFederatedIDRequest) (*proto.User, error)

func (*GRPCServer) AddUserWithPassword

func (m *GRPCServer) AddUserWithPassword(ctx context.Context, in *proto.AddUserWithPasswordRequest) (*proto.User, error)

func (*GRPCServer) AllDeviceTokens

func (*GRPCServer) AttachDeviceToken

func (m *GRPCServer) AttachDeviceToken(ctx context.Context, in *proto.AttachDeviceTokenRequest) (*proto.Empty, error)

func (*GRPCServer) CheckPassword

func (m *GRPCServer) CheckPassword(ctx context.Context, in *proto.CheckPasswordRequest) (*proto.Empty, error)

func (*GRPCServer) Close

func (m *GRPCServer) Close(ctx context.Context, in *proto.CloseRequest) (*proto.Empty, error)

func (*GRPCServer) DeleteUser

func (m *GRPCServer) DeleteUser(ctx context.Context, in *proto.DeleteUserRequest) (*proto.Empty, error)

func (*GRPCServer) DetachDeviceToken

func (m *GRPCServer) DetachDeviceToken(ctx context.Context, in *proto.DetachDeviceTokenRequest) (*proto.Empty, error)

func (*GRPCServer) FetchUsers

func (*GRPCServer) ImportJSON

func (m *GRPCServer) ImportJSON(ctx context.Context, in *proto.ImportJSONRequest) (*proto.Empty, error)

func (*GRPCServer) ResetPassword

func (m *GRPCServer) ResetPassword(ctx context.Context, in *proto.ResetPasswordRequest) (*proto.Empty, error)

func (*GRPCServer) UpdateLoginMetadata

func (m *GRPCServer) UpdateLoginMetadata(ctx context.Context, in *proto.UpdateLoginMetadataRequest) (*proto.Empty, error)

func (*GRPCServer) UpdateUser

func (m *GRPCServer) UpdateUser(ctx context.Context, in *proto.UpdateUserRequest) (*proto.User, error)

func (*GRPCServer) UserByEmail

func (m *GRPCServer) UserByEmail(ctx context.Context, in *proto.UserByEmailRequest) (*proto.User, error)

func (*GRPCServer) UserByFederatedID

func (m *GRPCServer) UserByFederatedID(ctx context.Context, in *proto.UserByFederatedIDRequest) (*proto.User, error)

func (*GRPCServer) UserByID

func (m *GRPCServer) UserByID(ctx context.Context, in *proto.UserByIDRequest) (*proto.User, error)

func (*GRPCServer) UserByPhone

func (m *GRPCServer) UserByPhone(ctx context.Context, in *proto.UserByPhoneRequest) (*proto.User, error)

func (*GRPCServer) UserByUsername

func (m *GRPCServer) UserByUsername(ctx context.Context, in *proto.UserByUsernameRequest) (*proto.User, error)

Jump to

Keyboard shortcuts

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