Categorygithub.com/nixys/nxs-go-redmine/v5
modulepackage
5.1.1
Repository: https://github.com/nixys/nxs-go-redmine.git
Documentation: pkg.go.dev

# README

nxs-go-redmine

Introduction

Go client library for Redmine

Features

New in nxs-go-redmine v5

  • All implemented method updated to work with latest Redmine API version
  • All fields that may be omitted are now pointers
  • Replaced all IDs from int to int64
  • Includes for methods now are specified with named constants
  • Added tools to operate with filters and sorts

Who can use the tool

Developer teams or sysadmins who need to automate a business processes that works around Redmine.

Quickstart

Import

import "github.com/nixys/nxs-go-redmine/v5"

Initialize

To initialize this library you need to do:

  • Initialize context via call redmine.Init() function with specified values of Redmine endpoint and API key

After thar you be able to use all available methods to interact with Redmine API.

Example

In the example below will be printed a names for all active projects from Redmine

package main

import (
	"fmt"
	"os"

	redmine "github.com/nixys/nxs-go-redmine/v5"
)

func main() {

	// Get variables from environment for connect to Redmine server
	rdmnHost := os.Getenv("REDMINE_HOST")
	rdmnAPIKey := os.Getenv("REDMINE_API_KEY")
	if rdmnHost == "" || rdmnAPIKey == "" {
		fmt.Println("Init error: make sure environment variables `REDMINE_HOST` and `REDMINE_API_KEY` are defined")
		os.Exit(1)
	}

	r := redmine.Init(
		redmine.Settings{
			Endpoint: rdmnHost,
			APIKey:   rdmnAPIKey,
		},
	)

	fmt.Println("Init: success")

	// Get all active projects with additional 
	// fields (trackers, categories and modules)
	p, _, err := r.ProjectAllGet(
		redmine.ProjectAllGetRequest{
			Includes: []redmine.ProjectInclude{
				redmine.ProjectIncludeTrackers,
				redmine.ProjectIncludeIssueCategories,
				redmine.ProjectIncludeEnabledModules,
			},
			Filters: redmine.ProjectGetRequestFiltersInit().
				StatusSet(redmine.ProjectStatusActive),
		})
	if err != nil {
		fmt.Println("Projects get error:", err)
		os.Exit(1)
	}

	fmt.Println("Projects:")
	for _, e := range p.Projects {
		fmt.Println("-", e.Name)
	}
}

Run:

REDMINE_HOST="https://redmine.yourdomain.com" REDMINE_API_KEY="YOUR_API_KEY" go run main.go

For more examples see apps based on this library:

Roadmap

Following features are already in backlog for our development team and will be released soon:

  • Implement more Redmine API methods (let us know which one you want to see at first)
  • Improve error handling in the library

Feedback

For support and feedback please contact me:

License

nxs-go-redmine is released under the MIT License.

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

used only: get single user.
used only: get single user.
used only: get single user.
No description provided by the author
used only: get single user.
used only: get single user.
used only: get single user.
No description provided by the author
used only: get single user.
(since 2.6.0).
No description provided by the author
(since 4.2.0).
(since 3.4.0).
No description provided by the author
ProjectStatus const.
ProjectStatus const.
ProjectStatus const.
No description provided by the author
No description provided by the author
UserNotification const.
UserNotification const.
UserNotification const.
UserNotification const.
UserNotification const.
UserNotification const.
UserStatus const.
UserStatus const.
UserStatus const.
UserStatus const.
No description provided by the author

# Structs

AttachmentObject struct used for attachments get operations.
AttachmentUploadObject struct used for attachments upload operations.
Context struct used for store settings to communicate with Redmine API.
CustomFieldGetObject struct used for custom fields get operations in other methods.
CustomFieldObject struct used for custom fields get operations.
CustomFieldPossibleValueObject struct used for custom fields get operations.
CustomFieldUpdateObject struct used for custom fields insert and update operations in other methods.
EnumerationDocumentCategoryObject struct used for document categories get operations.
EnumerationPriorityObject struct used for priorities get operations.
EnumerationTimeEntryActivityObject struct used for time entry activities get operations.
GroupAddUserObject struct used for add new user into group.
GroupCreate struct used for groups create operations.
No description provided by the author
GroupMembershipObject struct used for groups get operations.
GroupMultiGetRequest contains data for making request to get limited groups count.
GroupObject struct used for groups get operations.
GroupResult stores groups requests processing result.
GroupSingleGetRequest contains data for making request to get specified group.
GroupUpdate struct used for groups update operations.
No description provided by the author
IDName used as embedded struct for other structs within package.
IssueAllGetRequest contains data for making request to get all issues satisfying specified filters.
IssueChangesetObject struct used for issues get operations.
IssueChildrenObject struct used for issues get operations.
IssueCreate struct used for issues create operations.
No description provided by the author
IssueGetRequestFilters contains data for making issues get request.
No description provided by the author
IssueJournalDetailObject struct used for issues get operations.
IssueJournalObject struct used for issues get operations.
IssueMultiGetRequest contains data for making request to get limited issues count satisfying specified filters.
IssueObject struct used for issues get operations.
IssueParentObject struct used for issues get operations.
IssueRelationObject struct used for issues get operations.
IssueResult stores issues requests processing result.
IssueSingleGetRequest contains data for making request to get specified issue.
IssueStatusObject struct used for issue_statuses get operations.
IssueUpdate struct used for issues update operations.
No description provided by the author
MembershipAdd struct used for project memberships add operations.
No description provided by the author
MembershipMultiGetRequest contains data for making request to get limited memberships count.
MembershipObject struct used for project memberships get operations.
MembershipResult stores project memberships requests processing result.
MembershipRoleObject struct used for project memberships get operations.
MembershipUpdate struct used for project memberships update operations.
No description provided by the author
ProjectAllGetRequest contains data for making request to get all projects satisfying specified filters.
ProjectCreate struct used for projects create operations.
No description provided by the author
ProjectGetRequestFilters contains data for making projects get request.
ProjectMultiGetRequest contains data for making request to get limited projects count satisfying specified filters.
ProjectObject struct used for projects get operations.
ProjectResult stores projects requests processing result.
ProjectSingleGetRequest contains data for making request to get specified project.
ProjectUpdate struct used for projects update operations.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
TimeEntryResult stores time entry requests processing result.
Empty struct (uses as placeholder).
No description provided by the author
No description provided by the author
TrackerObject struct used for trackers get operations.
UserAllGetRequest contains data for making request to get all users satisfying specified filters.
UserCreate struct used for users create operations.
No description provided by the author
UserCurrentGetRequest contains data for making request to get current user.
UserGetRequestFilters contains data for making users get request.
UserMembershipObject struct used for users get operations.
UserMultiGetRequest contains data for making request to get limited users count satisfying specified filters.
UserObject struct used for users get operations.
UserResult stores users requests processing result.
UserSingleGetRequest contains data for making request to get specified user.
UserUpdate struct used for users update operations.
No description provided by the author
WikiCreate struct used for wiki create operations.
No description provided by the author
WikiMultiObject struct used for wikies all get operations.
WikiObject struct used for wiki get operations.
WikiParentObject struct used for wikies get operations.
WikiSingleGetRequest contains data for making request to get specified wiki.
WikiUpdate struct used for wiki update operations.
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
ProjectStatus defines project status type.
No description provided by the author
No description provided by the author
UserNotification defines user notification type.
UserStatus defines user status type.
No description provided by the author