Documentation
¶
Index ¶
- type Server
- func (s *Server) CreateAccount(ctx context.Context, in *kazoku.Account) (*kazoku.Account, error)
- func (s *Server) CreateUserAccount(ctx context.Context, in *kazoku.UserAccount) (*kazoku.UserAccount, error)
- func (s *Server) GetAccount(ctx context.Context, in *kazoku.Account) (result *kazoku.Account, err error)
- func (s *Server) GetUserAccounts(ctx context.Context, in *kazoku.UserAccount) (results *kazoku.UserAccounts, err error)
- func (s *Server) RegisterServer(srv *ggrpc.Server)
- func (s *Server) StartServer()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { *grpc.Server kazoku.KazokuServer }
Server defines the structure of a server for the Kazoku service.
func NewServer ¶
func NewServer(config *service.ServerConfig) *Server
NewServer returns a new gRPC server for the Kazoku service.
func (*Server) CreateAccount ¶
CreateAccount creates a new account owned by the creating user ID.
func (*Server) CreateUserAccount ¶
func (s *Server) CreateUserAccount(ctx context.Context, in *kazoku.UserAccount) (*kazoku.UserAccount, error)
CreateUserAccount creates a new association between a user and an account.
func (*Server) GetAccount ¶
func (s *Server) GetAccount(ctx context.Context, in *kazoku.Account) (result *kazoku.Account, err error)
GetAccount finds an account by account ID.
func (*Server) GetUserAccounts ¶
func (s *Server) GetUserAccounts(ctx context.Context, in *kazoku.UserAccount) (results *kazoku.UserAccounts, err error)
GetUserAccounts finds all associated users for a given account ID, or all associated accounts for a given user ID.
func (*Server) RegisterServer ¶
RegisterServer registers the gRPC server as a Kazoku service handler.
func (*Server) StartServer ¶
func (s *Server) StartServer()
StartServer initializes the MongoDB connection and database and starts the server.
Click to show internal directories.
Click to hide internal directories.