account

package
v0.0.0-...-3eb5a89 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenGRPC

func ListenGRPC(s Service, port int) error

Types

type Account

type Account struct {
	ID          string               `json:"id"`
	Name        string               `json:"name"`
	Email       string               `json:"email"`
	SocialID    string               `json:"social_id"`
	PhotoURL    string               `json:"photoURL"`
	LocationURL string               `json:"locationURL"`
	LastUpdated *timestamp.Timestamp `json:"last_updated"`
}

type Client

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

func NewClient

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

func (*Client) Close

func (c *Client) Close()

func (*Client) GetAccount

func (c *Client) GetAccount(ctx context.Context, id string) (*Account, error)

func (*Client) GetAccounts

func (c *Client) GetAccounts(ctx context.Context, skip uint64, take uint64) ([]Account, error)

func (*Client) PostAccount

func (c *Client) PostAccount(ctx context.Context, name string, email string) (*Account, error)

type Repository

type Repository interface {
	Close()
	PutAccount(ctx context.Context, a Account) error
	GetAccountByID(ctx context.Context, id string) (*Account, error)
	ListAccounts(ctx context.Context, skip uint64, take uint64) ([]Account, error)
}

func NewMongoRepository

func NewMongoRepository(url string) (Repository, error)

func NewPostgresRepository

func NewPostgresRepository(url string) (Repository, error)

type Service

type Service interface {
	PostAccount(ctx context.Context, name string, email string) (*Account, error)
	GetAccount(ctx context.Context, id string) (*Account, error)
	GetAccounts(ctx context.Context, skip uint64, take uint64) ([]Account, error)
}

func NewService

func NewService(r Repository) Service

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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