user

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: BSD-2-Clause Imports: 1 Imported by: 1

Documentation

Overview

Package user implements transaction user and services

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service wraps YNAB user API endpoints

func NewService

func NewService(c api.ClientReader) *Service

NewService facilitates the creation of a new user service instance

func (*Service) GetUser

func (s *Service) GetUser() (*User, error)

GetUser fetches information about the authenticated user https://api.youneedabudget.com/v1#/User/getUser

Example
package main

import (
	"fmt"
	"reflect"

	"go.bmvs.io/ynab"
)

func main() {
	c := ynab.NewClient("<valid_ynab_access_token>")
	user, _ := c.User().GetUser()
	fmt.Println(reflect.TypeOf(user))

}
Output:

*user.User

type User

type User struct {
	ID string `json:"id"`
}

User represents an user

Jump to

Keyboard shortcuts

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