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

          Code:

          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))
          
          }
          
          *user.User
          

          type User

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

            User represents an user