monday

package module
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: MIT Imports: 11 Imported by: 0

README

Monday.com GraphQL API Client for Go

Build Status Go Report Card Docs License

Overview

go-monday is a simple client for the Monday.coms GraphQL API.

Installation

$ go get github.com/grokify/go-monday/...

Usage

See the example file examples/query/main.go.

Contributing

Features, Issues, and Pull Requests are always welcome.

To contribute:

  1. Fork it ( http://github.com/grokify/go-monday/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Please report issues and feature requests on Github.

Documentation

Index

Constants

View Source
const (
	ColumnValueTitleDate   = "Date"
	ColumnValueTitleStatus = "Status"
)
View Source
const (
	ColumnValueIDLink = "link"
)
View Source
const (
	MondayAPIURL = "https://api.monday.com/v2"
)

Variables

This section is empty.

Functions

func WrapQuery

func WrapQuery(gql string, wrap bool) string

Types

type Board

type Board struct {
	ID      string   `json:"id"`
	Name    string   `json:"name"`
	Columns []Column `json:"columns"`
	Owner   Owner    `json:"owner"`
	Items   []Item   `json:"items"`
	State   string   `json:"state"`
}

type Client

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

func NewClient

func NewClient(token string) Client

func (*Client) DoGraphQL

func (c *Client) DoGraphQL(gql Query) (*http.Response, error)

func (*Client) DoGraphQLString added in v0.2.0

func (c *Client) DoGraphQLString(gql string) (*http.Response, error)

func (*Client) DoJSON

func (c *Client) DoJSON(data []byte) (*http.Response, error)

type Column

type Column struct {
	ID    string `json:"id"`
	Title string `json:"title"`
	Type  string `json:"type"`
}

type ColumnValue

type ColumnValue struct {
	ID    string  `json:"id"`
	Title string  `json:"title"`
	Value *string `json:"value"`
	Text  *string `json:"text"`
}

type ColumnValueValue

type ColumnValueValue struct {
	URL       string     `json:"url,omitempty"`  // "title":"Link", "id":"link",
	Text      string     `json:"text,omitempty"` // "title":"Link", "id":"link",
	ChangedAt *time.Time `json:"changed_at"`
}

func ParseColumnValueValue

func ParseColumnValueValue(data []byte) (ColumnValueValue, error)

type Data

type Data struct {
	Boards []Board `json:"boards"`
}

type Item

type Item struct {
	ID           string        `json:"id"`
	Name         string        `json:"name"`
	State        string        `json:"state"`
	ColumnValues []ColumnValue `json:"column_values"`
}

func (*Item) Date

func (item *Item) Date() (time.Time, error)

func (*Item) FieldsSimple

func (item *Item) FieldsSimple() map[string]string

func (*Item) GetColumnValue

func (item *Item) GetColumnValue(name string, errorOnDupe bool) (ColumnValue, error)

func (*Item) LastChangedAtDateStatus

func (item *Item) LastChangedAtDateStatus() (time.Time, error)

type Owner

type Owner struct {
	ID int `json:"id"`
}

type Queries

type Queries []Query

type Query

type Query struct {
	Object string
	Where  Where
	Select Queries
	Wrap   bool
}

func BoardQuery

func BoardQuery(boardID string) Query

func (Query) String

func (q Query) String() string

type QueryRequest

type QueryRequest struct {
	Query string `json:"query"`
}

type Response

type Response struct {
	AccountID int  `json:"account_id"`
	Data      Data `json:"data"`
}

func QueryBoard added in v0.3.3

func QueryBoard(c Client, boardID string) (*Response, error)

type Where

type Where map[string]string

func (Where) String

func (w Where) String() string

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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