client

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

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

Go to latest
Published: Jan 21, 2020 License: AGPL-3.0 Imports: 11 Imported by: 2

Documentation

Overview

Package client contains the transverse metadata service client.

Index

Constants

View Source
const (
	OpGoalCreate = "goal_create"
	OpGoalUpdate = "goal_update"
)
View Source
const (
	OpUserCreate = "user_create"
	OpUserUpdate = "user_update"
	OpUserDelete = "user_delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(baseURI, token string) *Client

type Goal

type Goal struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	User        string  `json:"user"`
	Description string  `json:"description"`
	Target      float64 `json:"target"`
	ETA         int64   `json:"eta"`
	Archived    bool    `json:"archived"`
	Created     int64   `json:"created"`
	Updated     int64   `json:"updated"`
	Deleted     int64   `json:"deleted"`
}

type ServerError

type ServerError int

func (ServerError) Error

func (e ServerError) Error() string

type ServiceClient

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

func NewServiceClient

func NewServiceClient(baseURI string, token string) *ServiceClient

func (*ServiceClient) CreateGoal

func (c *ServiceClient) CreateGoal(goal Goal) error

func (*ServiceClient) CreateUser

func (c *ServiceClient) CreateUser(user User) error

func (*ServiceClient) DeleteUser

func (c *ServiceClient) DeleteUser(user User) error

func (*ServiceClient) GetGoal

func (c *ServiceClient) GetGoal(id string) (Goal, error)

func (*ServiceClient) GetUserByEmail

func (c *ServiceClient) GetUserByEmail(email string) (User, error)

func (*ServiceClient) GetUserByID

func (c *ServiceClient) GetUserByID(id string) (User, error)

func (*ServiceClient) GetUserGoals

func (c *ServiceClient) GetUserGoals(userID string, archived bool) (map[string]Goal, error)

func (*ServiceClient) UpdateGoal

func (c *ServiceClient) UpdateGoal(goal Goal) error

func (*ServiceClient) UpdateUser

func (c *ServiceClient) UpdateUser(user User) error

type User

type User struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Email        string `json:"email"`
	PasswordHash string `json:"password_hash,omitempty"`
	Verified     bool   `json:"verified"`
	Created      int64  `json:"created"`
	Updated      int64  `json:"updated"`
	Deleted      int64  `json:"deleted"`
	LastEmail    int64  `json:"last_email"`
}

Jump to

Keyboard shortcuts

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