Documentation ¶
Overview ¶
Package client contains the transverse metadata service client.
Index ¶
- Constants
- type Client
- type Goal
- type ServerError
- type ServiceClient
- func (c *ServiceClient) CreateGoal(goal Goal) error
- func (c *ServiceClient) CreateUser(user User) error
- func (c *ServiceClient) DeleteUser(user User) error
- func (c *ServiceClient) GetGoal(id string) (Goal, error)
- func (c *ServiceClient) GetUserByEmail(email string) (User, error)
- func (c *ServiceClient) GetUserByID(id string) (User, error)
- func (c *ServiceClient) GetUserGoals(userID string, archived bool) (map[string]Goal, error)
- func (c *ServiceClient) UpdateGoal(goal Goal) error
- func (c *ServiceClient) UpdateUser(user User) error
- type User
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 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) GetUserByEmail ¶
func (c *ServiceClient) GetUserByEmail(email string) (User, error)
func (*ServiceClient) GetUserByID ¶
func (c *ServiceClient) GetUserByID(id string) (User, error)
func (*ServiceClient) GetUserGoals ¶
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"` }
Click to show internal directories.
Click to hide internal directories.