wego

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 14 Imported by: 0

README

Wego

A go client for the Wekan REST API

Features

  • Automatic login and token renewal
  • 100% of the official API implemented
  • Implements Wekan REST API v6.97

Sample

// Create client.
// The client will automatically login and renew its token regularly.
c, err := wego.NewClient(wego.Options{
    RemoteAddr: "https://your.wekanboard.com",
    Username:   "user",
    Password:   "secure-password",
})
if err != nil {
    log.Fatal(err)
}

boards, err := c.GetPublicBoards(context.Background())
if err != nil {
    log.Fatal(err)
} 
fmt.Printf("Public boards: %+v\n", boards)

self, err := c.GetCurrentUser(context.Background())
if err != nil {
    log.Fatal(err)
}
fmt.Printf("Self: %+v\n", self)

other, err := c.GetUser(context.Background(), "user-id-of-somebody")
if err != nil {
    log.Fatal(err)
}
fmt.Printf("Other: %+v\n", other)

Known problems

The current state of the Wekan API is slightly brittle.
Some API funcs are implemented according to spec, but do currently not work on my testing instance.
I need to create issues in the Wekan repository for them.

Issues

When you find issues or bugs, please create an issue in this repository and/or submit a PR.

License

MIT, see LICENSE file of this repository.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type AddBoardMemberRequest

type AddBoardMemberRequest struct {
	Action        string `json:"action"`
	IsAdmin       bool   `json:"isAdmin"`
	IsNoComments  bool   `json:"isNoComments"`
	IsCommentOnly bool   `json:"isCommentOnly"`
}

type BoardAttachment

type BoardAttachment struct {
	AttachmentID   string `json:"attachmentId"`
	AttachmentName string `json:"attachmentName"`
	AttachmentType string `json:"attachmentType"`
	CardID         string `json:"cardId"`
	ListID         string `json:"listId"`
	SwimlaneID     string `json:"swimlaneId"`
}

type BoardLabel

type BoardLabel struct {
	ID    string `json:"_id"`
	Name  string `json:"name"`
	Color string `json:"color"`
}

type BoardMember

type BoardMember struct {
	UserID        string `json:"userId"`
	IsAdmin       bool   `json:"isAdmin"`
	IsActive      bool   `json:"isActive"`
	IsNoComments  bool   `json:"isNoComments"`
	IsCommentOnly bool   `json:"isCommentOnly"`
	IsWorker      bool   `json:"isWorker"`
}

type CardCustomField added in v0.0.2

type CardCustomField struct {
	ID    string `json:"_id"`
	Value any    `json:"value"`
}

type ChecklistItem

type ChecklistItem struct {
	ID         string `json:"_id"`
	Title      string `json:"title"`
	IsFinished bool   `json:"isFinished"`
}

type Client

type Client struct {
	closer.Closer
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts Options) (*Client, error)

func (*Client) AddBoardLabel

func (c *Client) AddBoardLabel(ctx context.Context, boardID, name, color string) (err error)

AddBoardLabel performs an add_board_label request against the Wekan server. See https://wekan.github.io/api/v5.13/#add_board_label

Note: Currently broken

func (*Client) AddBoardMember

func (c *Client) AddBoardMember(ctx context.Context, boardID, userID string, data AddBoardMemberRequest) (err error)

AddBoardMember performs a add_board_member request against the Wekan server. See https://wekan.github.io/api/v5.13/#add_board_member

func (*Client) AddCustomFieldDropdownItems

func (c *Client) AddCustomFieldDropdownItems(ctx context.Context, boardID, customFieldID string, items []string) (err error)

AddCustomFieldDropdownItems performs a add_custom_field_dropdown_items request against the Wekan server. See https://wekan.github.io/api/v5.13/#add_custom_field_dropdown_items

func (*Client) CreateUserToken

func (c *Client) CreateUserToken(ctx context.Context, userID string) (r CreateUserTokenResponse, err error)

CreateUserToken performs a create_user_token request against the Wekan server. See https://wekan.github.io/api/v5.13/#create_user_token

func (*Client) DeleteBoard

func (c *Client) DeleteBoard(ctx context.Context, boardID string) (err error)

DeleteBoard performs a delete_board request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_board

func (*Client) DeleteCard

func (c *Client) DeleteCard(ctx context.Context, boardID, cardID string) (err error)

DeleteCard performs a delete_card request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_card

func (*Client) DeleteChecklist

func (c *Client) DeleteChecklist(ctx context.Context, boardID, cardID, checklistID string) (err error)

DeleteChecklist performs a delete_checklist request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_checklist

func (*Client) DeleteChecklistItem

func (c *Client) DeleteChecklistItem(ctx context.Context, boardID, cardID, checklistID, itemID string) (err error)

DeleteChecklistItem performs a delete_checklist_item request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_checklist_item

func (*Client) DeleteComment

func (c *Client) DeleteComment(ctx context.Context, boardID, cardID, commentID string) (err error)

DeleteComment performs a delete_comment request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_comment

func (*Client) DeleteCustomField

func (c *Client) DeleteCustomField(ctx context.Context, boardID, customFieldID string) (err error)

DeleteCustomField performs a delete_custom_field request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_custom_field

func (*Client) DeleteCustomFieldDropdownItem

func (c *Client) DeleteCustomFieldDropdownItem(ctx context.Context, boardID, customFieldID, dropdownItem string) (err error)

DeleteCustomFieldDropdownItem performs a delete_custom_field request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_custom_field_dropdown_item

func (*Client) DeleteIntegration

func (c *Client) DeleteIntegration(ctx context.Context, boardID, integrationID string) (err error)

DeleteIntegration performs a delete_integration request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_integration

func (*Client) DeleteIntegrationActivities

func (c *Client) DeleteIntegrationActivities(ctx context.Context, boardID, integrationID string) (err error)

DeleteIntegrationActivities performs a delete_integration_activities request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_integration_activities

func (*Client) DeleteList

func (c *Client) DeleteList(ctx context.Context, boardID, listID string) (err error)

DeleteList performs a delete_list request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_list

func (*Client) DeleteSwimlane

func (c *Client) DeleteSwimlane(ctx context.Context, boardID, swimlaneID string) (err error)

DeleteSwimlane performs a delete_swimlane request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_swimlane

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, userID string) (err error)

DeleteUser performs a delete_user request against the Wekan server. See https://wekan.github.io/api/v5.13/#delete_user

func (*Client) EditCard

func (c *Client) EditCard(ctx context.Context, boardID, listID, cardID string, opts EditCardOptions) (r EditCardResponse, err error)

EditCard performs a edit_card request against the Wekan server. See https://wekan.github.io/api/v5.13/#edit_card

func (*Client) EditChecklistItem

func (c *Client) EditChecklistItem(ctx context.Context, boardID, cardID, checklistID, itemID string, data EditChecklistItemRequest) (err error)

EditChecklistItem performs a edit_checklist_item request against the Wekan server. See https://wekan.github.io/api/v5.13/#edit_checklist_item

func (*Client) EditCustomField

func (c *Client) EditCustomField(ctx context.Context, boardID string, data EditCustomFieldRequest) (r EditCustomFieldResponse, err error)

EditCustomField performs a edit_custom_field request against the Wekan server. See https://wekan.github.io/api/v5.13/#edit_custom_field

func (*Client) EditCustomFieldDropdownItems

func (c *Client) EditCustomFieldDropdownItems(ctx context.Context, boardID, customFieldID, dropdownItem, name string) (err error)

EditCustomFieldDropdownItems performs a edit_custom_field_dropdown_items request against the Wekan server. See https://wekan.github.io/api/v5.13/#edit_custom_field_dropdown_items

func (*Client) EditIntegration

func (c *Client) EditIntegration(ctx context.Context, boardID, integrationID string, data EditIntegrationOptions) (err error)

EditIntegration performs a edit_integration request against the Wekan server. See https://wekan.github.io/api/v5.13/#edit_integration

func (*Client) EditUser

func (c *Client) EditUser(ctx context.Context, userID, action string) (err error)

EditUser performs a edit_user request against the Wekan server. See https://wekan.github.io/api/v5.13/#edit_user

Note: Possible values for action:

  • takeOwnership: The admin takes the ownership of ALL boards of the user (archived and not archived) where the user is admin on.
  • disableLogin: Disable a user (the user is not allowed to login and his login tokens are purged)
  • enableLogin: Enable a user

func (*Client) ExportJSON

func (c *Client) ExportJSON(ctx context.Context, boardID string) (boardJSON json.RawMessage, err error)

ExportJSON performs an export_json request against the Wekan server. See https://wekan.github.io/api/v5.13/#exportjson

func (*Client) GetAllCards

func (c *Client) GetAllCards(ctx context.Context, boardID, listID string) (cards []GetAllCard, err error)

GetAllCards performs a get_all_cards request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_all_cards

func (*Client) GetAllChecklists

func (c *Client) GetAllChecklists(ctx context.Context, boardID, cardID string) (checklists []GetAllChecklist, err error)

GetAllChecklists performs a get_all_checklists request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_all_checklists

func (*Client) GetAllComments

func (c *Client) GetAllComments(ctx context.Context, boardID, cardID string) (comments []GetAllComment, err error)

GetAllComments performs a get_all_comments request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_all_comments

func (*Client) GetAllCustomFields

func (c *Client) GetAllCustomFields(ctx context.Context, boardID string) (fields []GetAllCustomField, err error)

GetAllCustomFields performs a get_all_custom_fields request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_all_custom_fields

func (*Client) GetAllIntegrations

func (c *Client) GetAllIntegrations(ctx context.Context, boardID string) (integrations []Integration, err error)

GetAllIntegrations performs a get_all_integrations request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_all_integrations

func (*Client) GetAllLists

func (c *Client) GetAllLists(ctx context.Context, boardID string) (lists []GetAllList, err error)

GetAllLists performs a get_all_lists request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_all_lists

func (*Client) GetAllSwimlanes

func (c *Client) GetAllSwimlanes(ctx context.Context, boardID string) (swimlanes []GetAllSwimlane, err error)

GetAllSwimlanes performs a get_all_swimlanes request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_all_swimlanes

func (*Client) GetAllUsers

func (c *Client) GetAllUsers(ctx context.Context) (users []GetAllUser, err error)

GetAllUsers performs a get_all_users request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_all_users

func (*Client) GetBoard

func (c *Client) GetBoard(ctx context.Context, boardID string) (r GetBoard, err error)

GetBoard performs a get_board request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_board

Returns ErrNotFound, if the board could not be found.

func (*Client) GetBoardAttachments

func (c *Client) GetBoardAttachments(ctx context.Context, boardID string) (attachments []BoardAttachment, err error)

GetBoardAttachments performs a get_board_attachments request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_board_attachments

func (*Client) GetBoardsCount

func (c *Client) GetBoardsCount(ctx context.Context) (r GetBoardsCountResponse, err error)

GetBoardsCount performs a get_boards_count request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_boards_count

func (*Client) GetBoardsFromUser

func (c *Client) GetBoardsFromUser(ctx context.Context, userID string) (r []GetBoardFromUser, err error)

GetBoardsFromUser performs a get_boards_from_user request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_boards_from_user

func (*Client) GetCard

func (c *Client) GetCard(ctx context.Context, boardID, listID, cardID string) (card GetCard, err error)

GetCard performs a get_card request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_card

Returns ErrNotFound, if the card could not be found.

func (*Client) GetCardsByCustomField

func (c *Client) GetCardsByCustomField(ctx context.Context, boardID, customField, customFieldValue string) (cards []GetCardByCustomField, err error)

GetCardsByCustomField performs a get_cards_by_custom_field request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_cards_by_custom_field

func (*Client) GetChecklist

func (c *Client) GetChecklist(ctx context.Context, boardID, cardID, checklistID string) (checklist GetChecklist, err error)

GetChecklist performs a get_checklist request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_checklist

func (*Client) GetChecklistItem

func (c *Client) GetChecklistItem(ctx context.Context, boardID, cardID, checklistID, itemID string) (item GetChecklistItem, err error)

GetChecklistItem performs a get_checklist_item request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_checklist_item

func (*Client) GetComment

func (c *Client) GetComment(ctx context.Context, boardID, cardID, commentID string) (comment GetComment, err error)

GetComment performs a get_comment request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_comment

Returns ErrNotFound, if the comment could not be found.

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser(ctx context.Context) (u User, err error)

GetCurrentUser performs a get_current_user request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_current_user

func (*Client) GetCurrentUserID

func (c *Client) GetCurrentUserID() (id string)

GetCurrentUserID returns the id of the logged in user. This is an additional convenience method that has no pendant in the Wekan API.

func (*Client) GetCustomField

func (c *Client) GetCustomField(ctx context.Context, boardID string) (resp []GetCustomField, err error)

GetCustomField performs a get_custom_field request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_all_custom_fields

func (*Client) GetIntegration

func (c *Client) GetIntegration(ctx context.Context, boardID, integrationID string) (integration Integration, err error)

GetIntegration performs a get_integration request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_integration

Returns ErrNotFound, if the integration could not be found.

func (*Client) GetList

func (c *Client) GetList(ctx context.Context, boardID, listID string) (list GetList, err error)

GetList performs a get_list request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_list

Returns ErrNotFound, if the list could not be found.

func (*Client) GetPublicBoards

func (c *Client) GetPublicBoards(ctx context.Context) (boards []GetPublicBoard, err error)

GetPublicBoards performs a get_public_boards request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_public_boards

func (*Client) GetSwimlane

func (c *Client) GetSwimlane(ctx context.Context, boardID, swimlaneID string) (swimlane GetSwimlane, err error)

GetSwimlane performs a get_swimlane request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_swimlane

Returns ErrNotFound, if the swimlane could not be found.

func (*Client) GetSwimlaneCards

func (c *Client) GetSwimlaneCards(ctx context.Context, boardID, swimlaneID string) (cards []GetSwimlaneCard, err error)

GetSwimlaneCards performs a get_swimlane_cards request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_swimlane_cards

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, userID string) (user User, err error)

GetUser performs a get_user request against the Wekan server. See https://wekan.github.io/api/v5.13/#get_user

Returns ErrNotFound, if the user could not be found.

func (*Client) Login

func (c *Client) Login(ctx context.Context, username, password string) (r LoginResponse, err error)

Login performs a login request against the Wekan server. See https://wekan.github.io/api/v5.13/#wekan-rest-api-login

Note: The client ensures to authenticate against the API on its own. It is not required to call this method for normal usage.

func (*Client) NewBoard

func (c *Client) NewBoard(ctx context.Context, request NewBoardRequest) (r NewBoardResponse, err error)

NewBoard performs a new_board request against the Wekan server. See https://wekan.github.io/api/v5.13/#new_board

Note: Owner must be a userID, not an email or username.

func (*Client) NewCard

func (c *Client) NewCard(ctx context.Context, boardID, listID string, request NewCardRequest) (r NewCardResponse, err error)

NewCard performs a new_card request against the Wekan server. See https://wekan.github.io/api/v5.13/#new_card

func (*Client) NewChecklist

func (c *Client) NewChecklist(ctx context.Context, boardID, cardID string, data NewChecklistRequest) (r NewChecklistResponse, err error)

NewChecklist performs a new_checklist request against the Wekan server. See https://wekan.github.io/api/v5.13/#new_checklist

func (*Client) NewComment

func (c *Client) NewComment(ctx context.Context, boardID, cardID string, data NewCommentRequest) (r NewCommentResponse, err error)

NewComment performs a new_comment request against the Wekan server. See https://wekan.github.io/api/v5.13/#new_comment

func (*Client) NewCustomField

func (c *Client) NewCustomField(ctx context.Context, boardID string, data NewCustomFieldRequest) (r NewCustomFieldResponse, err error)

NewCustomField performs a new_custom_field request against the Wekan server. See https://wekan.github.io/api/v5.13/#new_custom_field

func (*Client) NewIntegration

func (c *Client) NewIntegration(ctx context.Context, boardID, url string) (r NewIntegrationResponse, err error)

NewIntegration performs a new_integration request against the Wekan server. See https://wekan.github.io/api/v5.13/#new_integration

func (*Client) NewIntegrationActivities

func (c *Client) NewIntegrationActivities(ctx context.Context, boardID, integrationID string, activities []string) (integration Integration, err error)

NewIntegrationActivities performs a new_integration_activities request against the Wekan server. See https://wekan.github.io/api/v5.13/#new_integration_activities

func (*Client) NewList

func (c *Client) NewList(ctx context.Context, boardID, title string) (r NewListResponse, err error)

NewList performs a new_list request against the Wekan server. See https://wekan.github.io/api/v5.13/#new_list

func (*Client) NewSwimlane

func (c *Client) NewSwimlane(ctx context.Context, boardID, title string) (r NewSwimlaneResponse, err error)

NewSwimlane performs a new_swimlane request against the Wekan server. See https://wekan.github.io/api/v5.13/#new_swimlane

func (*Client) NewUser

func (c *Client) NewUser(ctx context.Context, data NewUserRequest) (r NewUserResponse, err error)

NewUser performs a new_user request against the Wekan server. See https://wekan.github.io/api/v5.13/#new_user

func (*Client) Register

func (c *Client) Register(ctx context.Context, username, password, email string) (r LoginResponse, err error)

Register performs a register request against the Wekan server. See https://wekan.github.io/api/v5.13/#register

func (*Client) RemoveBoardMember

func (c *Client) RemoveBoardMember(ctx context.Context, boardID, userID string) (err error)

RemoveBoardMember performs a remove_board_member request against the Wekan server. See https://wekan.github.io/api/v5.13/#remove_board_member

func (*Client) SetBoardMemberPermission

func (c *Client) SetBoardMemberPermission(ctx context.Context, boardID, memberID string, opts SetBoardMemberPermissionOptions) (err error)

SetBoardMemberPermission performs an set_board_member_permission request against the Wekan server. See https://wekan.github.io/api/v5.13/#set_board_member_permission

type CreateUserTokenResponse

type CreateUserTokenResponse struct {
	ID string `json:"_id"`
}

type EditCardOptions

type EditCardOptions struct {
	Title        string            `json:"title,omitempty"`
	Sort         string            `json:"sort,omitempty"`
	ParentID     string            `json:"parentId,omitempty"`
	Description  string            `json:"description,omitempty"`
	Color        string            `json:"color,omitempty"`
	Vote         *Vote             `json:"vote,omitempty"`
	Poker        *Poker            `json:"poker,omitempty"`
	LabelIDs     []string          `json:"labelIds,omitempty"`
	RequestedBy  string            `json:"requestedBy,omitempty"`
	AssignedBy   string            `json:"assignedBy,omitempty"`
	ReceivedAt   *time.Time        `json:"receivedAt,omitempty"`
	StartAt      *time.Time        `json:"startAt,omitempty"`
	DueAt        *time.Time        `json:"dueAt,omitempty"`
	EndAt        *time.Time        `json:"endAt,omitempty"`
	SpentTime    string            `json:"spentTime,omitempty"`
	IsOverTime   bool              `json:"isOverTime,omitempty"`
	CustomFields []CardCustomField `json:"customFields,omitempty"`
	Members      []string          `json:"members,omitempty"`
	Assignees    []string          `json:"assignees,omitempty"`
	SwimlaneID   string            `json:"swimlaneId,omitempty"`
	ListID       string            `json:"listId,omitempty"`
	AuthorID     string            `json:"authorId,omitempty"`
}

type EditCardResponse

type EditCardResponse struct {
	ID string `json:"_id"`
}

type EditChecklistItemRequest

type EditChecklistItemRequest struct {
	Title      string `json:"title"`
	IsFinished bool   `json:"isFinished"`
}

type EditCustomFieldRequest

type EditCustomFieldRequest struct {
	Name                string `json:"name"`
	Type                string `json:"type"`
	Settings            string `json:"settings"`
	ShowOnCard          bool   `json:"showOnCard"`
	AutomaticallyOnCard bool   `json:"automaticallyOnCard"`
	AlwaysOnCard        bool   `json:"alwaysOnCard"`
	ShowLabelOnMiniCard bool   `json:"showLabelOnMiniCard"`
}

type EditCustomFieldResponse

type EditCustomFieldResponse struct {
	ID string `json:"_id"`
}

type EditIntegrationOptions

type EditIntegrationOptions struct {
	Enabled    bool     `json:"enabled"`
	Title      string   `json:"title"`
	Url        string   `json:"url"`
	Token      string   `json:"token"`
	Activities []string `json:"activities"`
}

type GetAllCard

type GetAllCard struct {
	ID          string `json:"_id"`
	Title       string `json:"title"`
	Description string `json:"description"`
}

type GetAllChecklist

type GetAllChecklist struct {
	ID    string `json:"_id"`
	Title string `json:"title"`
}

type GetAllComment

type GetAllComment struct {
	ID       string `json:"_id"`
	Comment  string `json:"comment"`
	AuthorID string `json:"authorId"`
}

type GetAllCustomField

type GetAllCustomField struct {
	ID   string `json:"_id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

type GetAllList

type GetAllList struct {
	ID    string `json:"_id"`
	Title string `json:"title"`
}

type GetAllSwimlane

type GetAllSwimlane struct {
	ID    string `json:"_id"`
	Title string `json:"title"`
}

type GetAllUser

type GetAllUser struct {
	ID       string `json:"_id"`
	Username string `json:"username"`
}

type GetBoard

type GetBoard struct {
	Title                      string        `json:"title"`
	Slug                       string        `json:"slug"`
	Archived                   bool          `json:"archived"`
	ArchivedAt                 time.Time     `json:"archivedAt"`
	CreatedAt                  time.Time     `json:"createdAt"`
	ModifiedAt                 time.Time     `json:"modifiedAt"`
	Stars                      int           `json:"stars"`
	Labels                     []BoardLabel  `json:"labels"`
	Members                    []BoardMember `json:"members"`
	Permission                 string        `json:"permission"`
	Color                      string        `json:"color"`
	Description                string        `json:"description"`
	SubtasksDefaultBoardID     string        `json:"subtasksDefaultBoardId"`
	SubtasksDefaultListID      string        `json:"subtasksDefaultListId"`
	DateSettingsDefaultBoardID string        `json:"dateSettingsDefaultBoardId"`
	DateSettingsDefaultListID  string        `json:"dateSettingsDefaultListId"`
	AllowsSubtasks             bool          `json:"allowsSubtasks"`
	AllowsAttachments          bool          `json:"allowsAttachments"`
	AllowsChecklists           bool          `json:"allowsChecklists"`
	AllowsComments             bool          `json:"allowsComments"`
	AllowsDescriptionTitle     bool          `json:"allowsDescriptionTitle"`
	AllowsDescriptionText      bool          `json:"allowsDescriptionText"`
	AllowsActivities           bool          `json:"allowsActivities"`
	AllowsLabels               bool          `json:"allowsLabels"`
	AllowsAssignee             bool          `json:"allowsAssignee"`
	AllowsMembers              bool          `json:"allowsMembers"`
	AllowsRequestedBy          bool          `json:"allowsRequestedBy"`
	AllowsAssignedBy           bool          `json:"allowsAssignedBy"`
	AllowsReceivedDate         bool          `json:"allowsReceivedDate"`
	AllowsStartDate            bool          `json:"allowsStartDate"`
	AllowsEndDate              bool          `json:"allowsEndDate"`
	AllowsDueDate              bool          `json:"allowsDueDate"`
	PresentParentTask          string        `json:"presentParentTask"`
	StartAt                    string        `json:"startAt"`
	DueAt                      string        `json:"dueAt"`
	EndAt                      string        `json:"endAt"`
	SpentTime                  int           `json:"spentTime"`
	IsOvertime                 bool          `json:"isOvertime"`
	Type                       string        `json:"type"`
	Sort                       float32       `json:"sort"`
}

type GetBoardFromUser

type GetBoardFromUser struct {
	ID    string `json:"_id"`
	Title string `json:"title"`
}

type GetBoardsCountResponse

type GetBoardsCountResponse struct {
	Private int `json:"private"`
	Public  int `json:"public"`
}

type GetCard

type GetCard struct {
	Title            string            `json:"title"`
	Archived         bool              `json:"archived"`
	ArchivedAt       string            `json:"archivedAt"`
	ParentID         string            `json:"parentId"`
	ListID           string            `json:"listId"`
	SwimlaneID       string            `json:"swimlaneId"`
	BoardID          string            `json:"boardId"`
	CoverID          string            `json:"coverId"`
	Color            string            `json:"color"`
	CreatedAt        string            `json:"createdAt"`
	ModifiedAt       string            `json:"modifiedAt"`
	CustomFields     []CardCustomField `json:"customFields"`
	DateLastActivity string            `json:"dateLastActivity"`
	Description      string            `json:"description"`
	RequestedBy      string            `json:"requestedBy"`
	AssignedBy       string            `json:"assignedBy"`
	LabelIds         []string          `json:"labelIds"`
	Members          []string          `json:"members"`
	Assignees        []string          `json:"assignees"`
	ReceivedAt       string            `json:"receivedAt"`
	StartAt          string            `json:"startAt"`
	DueAt            string            `json:"dueAt"`
	EndAt            string            `json:"endAt"`
	SpentTime        int               `json:"spentTime"`
	IsOvertime       bool              `json:"isOvertime"`
	UserID           string            `json:"userId"`
	Sort             float64           `json:"sort"`
	SubtaskSort      int               `json:"subtaskSort"`
	Type             string            `json:"type"`
	LinkedID         string            `json:"linkedId"`
	Vote             Vote              `json:"vote"`
	Poker            Poker             `json:"poker"`
	TargetIDGantt    []string          `json:"targetId_gantt"`
	LinkTypeGantt    []int             `json:"linkType_gantt"`
	LinkIDGantt      []string          `json:"linkId_gantt"`
	CardNumber       int               `json:"cardNumber"`
}

type GetCardByCustomField

type GetCardByCustomField struct {
	ID          string `json:"_id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	ListID      string `json:"listId"`
	SwimlaneID  string `json:"swimlaneId"`
}

type GetChecklist

type GetChecklist struct {
	CardId     string          `json:"cardId"`
	Title      string          `json:"title"`
	FinishedAt string          `json:"finishedAt"`
	CreatedAt  string          `json:"createdAt"`
	Sort       int             `json:"sort"`
	Items      []ChecklistItem `json:"items"`
}

type GetChecklistItem

type GetChecklistItem struct {
	Title       string `json:"title"`
	Sort        int    `json:"sort"`
	IsFinished  bool   `json:"isFinished"`
	ChecklistID string `json:"checklistId"`
	CardID      string `json:"cardId"`
	CreatedAt   string `json:"createdAt"`
	ModifiedAt  string `json:"modifiedAt"`
}

type GetComment

type GetComment struct {
	BoardID    string `json:"boardId"`
	CardID     string `json:"cardId"`
	Text       string `json:"text"`
	CreatedAt  string `json:"createdAt"`
	ModifiedAt string `json:"modifiedAt"`
	UserID     string `json:"userId"`
}

type GetCustomField

type GetCustomField struct {
	ID       string `json:"_id"`
	BoardIDs string `json:"boardIds"`
}

type GetList

type GetList struct {
	Title      string       `json:"title"`
	Starred    bool         `json:"starred"`
	Archived   bool         `json:"archived"`
	ArchivedAt string       `json:"archivedAt"`
	BoardID    string       `json:"boardId"`
	SwimlaneID string       `json:"swimlaneId"`
	CreatedAt  string       `json:"createdAt"`
	Sort       int          `json:"sort"`
	UpdatedAt  string       `json:"updatedAt"`
	ModifiedAt string       `json:"modifiedAt"`
	WipLimit   ListWIPLimit `json:"wipLimit"`
	Color      string       `json:"color"`
	Type       string       `json:"type"`
}

type GetPublicBoard

type GetPublicBoard struct {
	ID    string `json:"_id"`
	Title string `json:"title"`
}

type GetSwimlane

type GetSwimlane struct {
	Title      string `json:"title"`
	Archived   bool   `json:"archived"`
	ArchivedAt string `json:"archivedAt"`
	BoardID    string `json:"boardId"`
	CreatedAt  string `json:"createdAt"`
	Sort       int    `json:"sort"`
	Color      string `json:"color"`
	UpdatedAt  string `json:"updatedAt"`
	ModifiedAt string `json:"modifiedAt"`
	Type       string `json:"type"`
}

type GetSwimlaneCard

type GetSwimlaneCard struct {
	ID          string `json:"_id"`
	Title       string `json:"title"`
	Description string `json:"description"`
	ListID      string `json:"listId"`
}

type Integration

type Integration struct {
	Enabled    bool     `json:"enabled"`
	Title      string   `json:"title"`
	Type       string   `json:"type"`
	Activities []string `json:"activities"`
	Url        string   `json:"url"`
	Token      string   `json:"token"`
	BoardID    string   `json:"boardId"`
	CreatedAt  string   `json:"createdAt"`
	ModifiedAt string   `json:"modifiedAt"`
	UserID     string   `json:"userId"`
}

type ListWIPLimit

type ListWIPLimit struct {
	Value   int  `json:"value"`
	Enabled bool `json:"enabled"`
	Soft    bool `json:"soft"`
}

type LoginResponse

type LoginResponse struct {
	ID           string
	Token        string
	TokenExpires time.Time
}

type NewBoardOptions

type NewBoardOptions struct {
	IsAdmin       bool   `json:"isAdmin"`
	IsActive      bool   `json:"isActive"`
	IsNoComments  bool   `json:"isNoComments"`
	IsCommentOnly bool   `json:"isCommentOnly"`
	IsWorker      bool   `json:"isWorker"`
	Permission    string `json:"permission"`
	Color         string `json:"color"`
}

type NewBoardRequest

type NewBoardRequest struct {
	// Required
	Title string `json:"title"`
	Owner string `json:"owner"`

	// Optional
	NewBoardOptions `json:",inline"`
}

type NewBoardResponse

type NewBoardResponse struct {
	ID                string `json:"_id"`
	DefaultSwimlaneID string `json:"defaultSwimlaneId"`
}

type NewCardOptions

type NewCardOptions struct {
	MemberIDs []string `json:"members,omitempty"`
	Assignees []string `json:"assignees,omitempty"`
}

type NewCardRequest

type NewCardRequest struct {
	// Required
	AuthorID    string `json:"authorId"`
	Title       string `json:"title"`
	Description string `json:"description"`
	SwimlaneID  string `json:"swimlaneId"`

	// Optional
	NewCardOptions `json:",inline"`
}

type NewCardResponse

type NewCardResponse struct {
	ID string `json:"_id"`
}

type NewChecklistRequest

type NewChecklistRequest struct {
	Title string   `json:"title"`
	Items []string `json:"items"`
}

type NewChecklistResponse

type NewChecklistResponse struct {
	ID string `json:"_id"`
}

type NewCommentRequest

type NewCommentRequest struct {
	AuthorID string `json:"authorId"`
	Comment  string `json:"comment"`
}

type NewCommentResponse

type NewCommentResponse struct {
	ID string `json:"_id"`
}

type NewCustomFieldRequest

type NewCustomFieldRequest struct {
	Name                string `json:"name"`
	Type                string `json:"type"`
	Settings            string `json:"settings"`
	ShowOnCard          bool   `json:"showOnCard"`
	AutomaticallyOnCard bool   `json:"automaticallyOnCard"`
	ShowLabelOnMiniCard bool   `json:"showLabelOnMiniCard"`
	AuthorId            string `json:"authorId"`
}

type NewCustomFieldResponse

type NewCustomFieldResponse struct {
	ID string `json:"_id"`
}

type NewIntegrationResponse

type NewIntegrationResponse struct {
	ID string `json:"_id"`
}

type NewListResponse

type NewListResponse struct {
	ID string `json:"_id"`
}

type NewSwimlaneResponse

type NewSwimlaneResponse struct {
	ID string `json:"_id"`
}

type NewUserRequest

type NewUserRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Email    string `json:"email"`
}

type NewUserResponse

type NewUserResponse struct {
	ID string `json:"_id"`
}

type Options

type Options struct {

	// The address of the wekan server the client should connect to.
	RemoteAddr string
	// The username of the user that should be used to log in.
	Username string
	// The password of the user that should be used to log in.
	Password string

	// The HTTP client that should be used.
	// If nil, a default client is used.
	Client *http.Client

	// The time the client waits between login attempts.
	// Can not be shorter than 1 second.
	TimeBetweenLoginAttemps time.Duration

	// The closer used to manage all routines of the client.
	// If nil, a default closer is created.
	Closer closer.Closer
}

type Poker added in v0.0.2

type Poker struct {
	Question             bool     `json:"question,omitempty"`
	One                  []string `json:"one,omitempty"`
	Two                  []string `json:"two,omitempty"`
	Three                []string `json:"three,omitempty"`
	Five                 []string `json:"five,omitempty"`
	Eight                []string `json:"eight,omitempty"`
	Thirteen             []string `json:"thirteen,omitempty"`
	Twenty               []string `json:"twenty,omitempty"`
	Forty                []string `json:"forty,omitempty"`
	OneHundred           []string `json:"oneHundred,omitempty"`
	Unsure               []string `json:"unsure,omitempty"`
	End                  string   `json:"end,omitempty"`
	AllowNonBoardMembers bool     `json:"allowNonBoardMembers,omitempty"`
	Estimation           int      `json:"estimation,omitempty"`
}

type SetBoardMemberPermissionOptions

type SetBoardMemberPermissionOptions struct {
	IsAdmin       bool `json:"isAdmin"`
	IsNoComments  bool `json:"isNoComments"`
	IsCommentOnly bool `json:"isCommentOnly"`
	IsWorker      bool `json:"isWorker"`
}

type User

type User struct {
	Username             string          `json:"username"`
	Emails               []UserEmail     `json:"emails"`
	CreatedAt            string          `json:"createdAt"`
	ModifiedAt           string          `json:"modifiedAt"`
	Profile              UserProfile     `json:"profile"`
	Services             json.RawMessage `json:"services"`
	Heartbeat            string          `json:"heartbeat"`
	IsAdmin              bool            `json:"isAdmin"`
	CreatedThroughApi    bool            `json:"createdThroughApi"`
	LoginDisabled        bool            `json:"loginDisabled"`
	AuthenticationMethod string          `json:"authenticationMethod"`
	SessionData          UserSessionData `json:"sessionData"`
	ImportUsernames      []string        `json:"importUsernames"`
}

type UserEmail

type UserEmail struct {
	Address  string `json:"address"`
	Verified bool   `json:"verified"`
}

type UserProfile

type UserProfile struct {
	AvatarUrl                string          `json:"avatarUrl"`
	EmailBuffer              []string        `json:"emailBuffer"`
	Fullname                 string          `json:"fullname"`
	ShowDesktopDragHandles   bool            `json:"showDesktopDragHandles"`
	HideCheckedItems         bool            `json:"hideCheckedItems"`
	HiddenSystemMessages     bool            `json:"hiddenSystemMessages"`
	HiddenMinicardLabelText  bool            `json:"hiddenMinicardLabelText"`
	Initials                 string          `json:"initials"`
	InvitedBoards            []string        `json:"invitedBoards"`
	Language                 string          `json:"language"`
	Notifications            json.RawMessage `json:"notifications"`
	Activity                 string          `json:"activity"`
	Read                     string          `json:"read"`
	ShowCardsCountAt         int             `json:"showCardsCountAt"`
	StartDayOfWeek           int             `json:"startDayOfWeek"`
	StarredBoards            []string        `json:"starredBoards"`
	Icode                    string          `json:"icode"`
	BoardView                string          `json:"boardView"`
	ListSortBy               string          `json:"listSortBy"`
	TemplatesBoardID         string          `json:"templatesBoardId"`
	CardTemplatesSwimlaneID  string          `json:"cardTemplatesSwimlaneId"`
	ListTemplatesSwimlaneID  string          `json:"listTemplatesSwimlaneId"`
	BoardTemplatesSwimlaneID string          `json:"boardTemplatesSwimlaneId"`
}

type UserSessionData

type UserSessionData struct {
	TotalHits int `json:"totalHits"`
	LastHit   int `json:"lastHit"`
}

type Vote added in v0.0.2

type Vote struct {
	Question             string   `json:"question,omitempty"`
	Positive             []string `json:"positive,omitempty"`
	Negative             []string `json:"negative,omitempty"`
	End                  string   `json:"end,omitempty"`
	Public               bool     `json:"public,omitempty"`
	AllowNonBoardMembers bool     `json:"allowNonBoardMembers,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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