productive

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnauthorized = errors.New("unauthorized access")

Functions

func FromJsonMany

func FromJsonMany(json io.Reader, t reflect.Type) ([]interface{}, error)

func ToJsonEmbedded

func ToJsonEmbedded(model interface{}) ([]byte, error)

Types

type Client

type Client struct {
	SessionService                *sessionService
	DealService                   *dealsService
	ServiceService                *serviceService
	OrganizationMembershipService *organizationMembershipService
	TimeEntryService              *timeEntryService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client) *Client

func (*Client) Do

func (client *Client) Do(request *http.Request) (io.Reader, error)

func (*Client) NewRequest

func (client *Client) NewRequest(
	method string,
	urlPath string,
	body interface{},
	headers map[string]string,
) (*http.Request, error)

type Deal

type Deal struct {
	ID   string `jsonapi:"primary,deals"`
	Name string `jsonapi:"attr,name"`
}

type OrganizationMembership

type OrganizationMembership struct {
	ID   string  `jsonapi:"primary,organization_memberships"`
	User *Person `jsonapi:"relation,person"`
}

type Person

type Person struct {
	ID string `jsonapi:"primary,people"`
}

type Service

type Service struct {
	ID   string `jsonapi:"primary,services"`
	Name string `jsonapi:"attr,name"`
}

type SessionRequest

type SessionRequest struct {
	ID       string `jsonapi:"primary,sessions"`
	Otp      string `jsonapi:"attr,otp"`
	Email    string `jsonapi:"attr,email,omitempty"`
	Password string `jsonapi:"attr,password"`
	Token    string `jsonapi:"attr,token"`
	User     *User  `jsonapi:"relation,user"`
}

type SessionResponse

type SessionResponse struct {
	ID                  string `jsonapi:"primary,sessions"`
	Token               string `jsonapi:"attr,token"`
	TokenExpirationDate string `jsonapi:"attr,token_expires_at"`
	Is2FaAuthed         bool   `jsonapi:"attr,two_factor_auth"`
	User                *User  `jsonapi:"relation,user"`
}

type TimeEntryRequest

type TimeEntryRequest struct {
	ID     string   `jsonapi:"primary,time-entries"`
	Date   string   `jsonapi:"attr,date"`
	Note   string   `jsonapi:"attr,note"`
	Time   string   `jsonapi:"attr,time"`
	Person *Person  `jsonapi:"relation,person"`
	Budget *Service `jsonapi:"relation,service"`
}

type User added in v0.0.3

type User struct {
	ID           string `jsonapi:"primary,users"`
	Is2FaEnabled bool   `jsonapi:"attr,two_factor_auth"`
}

Jump to

Keyboard shortcuts

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