rpc

package
v0.0.0-...-894ab8b Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2014 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package rpc provides the rpc user client used by the Polyglottis Application and a simple user server wrapper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUserServer

func NewUserServer(s user.Server, addr string) *rpc.Server

NewUserServer creates an rpc user server, forwarding calls to s, and listening on tcp address addr.

Types

type Client

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

Client is a user.Server which forwards method calls to another user.Server over rpc.

func NewClient

func NewClient(addr string) (*Client, error)

func (*Client) DeleteToken

func (c *Client) DeleteToken(n user.Name, token string) error

func (*Client) GetAccount

func (c *Client) GetAccount(n user.Name) (*user.Account, error)

func (*Client) GetAccountByEmail

func (c *Client) GetAccountByEmail(email string) (*user.Account, error)

func (*Client) NewAccount

func (c *Client) NewAccount(r *user.NewAccountRequest) (*user.Account, error)

func (*Client) NewToken

func (c *Client) NewToken(n user.Name) (token string, err error)

func (*Client) UpdateAccount

func (c *Client) UpdateAccount(a *user.Account) error

func (*Client) ValidToken

func (c *Client) ValidToken(n user.Name, token string) (valid bool, err error)

type NamedToken

type NamedToken struct {
	Name  user.Name
	Token string
}

type UserServer

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

UserServer is the rpc user server object. It is used internally by NewUserServer, and is not meant to be instantiated directly. It needs to be exported for rpc to work.

func (*UserServer) DeleteToken

func (s *UserServer) DeleteToken(t *NamedToken, nothing *bool) (err error)

func (*UserServer) GetAccount

func (s *UserServer) GetAccount(n user.Name, a *user.Account) error

func (*UserServer) GetAccountByEmail

func (s *UserServer) GetAccountByEmail(email string, a *user.Account) error

func (*UserServer) NewAccount

func (s *UserServer) NewAccount(r *user.NewAccountRequest, a *user.Account) error

func (*UserServer) NewToken

func (s *UserServer) NewToken(n user.Name, token *string) (err error)

func (*UserServer) UpdateAccount

func (s *UserServer) UpdateAccount(a *user.Account, nothing *bool) (err error)

func (*UserServer) ValidToken

func (s *UserServer) ValidToken(t *NamedToken, valid *bool) (err error)

Jump to

Keyboard shortcuts

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