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

# README

nxs-go-redmine

This Go package provides access to Redmine API.

Compatible with Redmine 4.2+

Follows Redmine resources are fully implemented at this moment:

Install

go get github.com/nixys/nxs-go-redmine/v3

Example of usage

You may find more examples in unit-tests in this repository

Get all projects from the Redmine server:

package main

import (
	"fmt"
	"os"

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

func main() {

	var r redmine.Context

	// 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)
	}

	// Init Redmine ctx 
	r.SetEndpoint(rdmnHost)
	r.SetAPIKey(rdmnAPIKey)

	fmt.Println("Init: success")

	// Get all projects 
	p, _, err := r.ProjectAllGet(ProjectAllGetRequest{
		Includes: []string{"trackers", "issue_categories", "enabled_modules"},
		Filters: ProjectGetRequestFilters{
			Status: 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

# Packages

No description provided by the author

# Constants

ProjectStatus const.
ProjectStatus const.
ProjectStatus const.
UserNotification const.
UserNotification const.
UserNotification const.
UserNotification const.
UserNotification const.
UserNotification const.
UserStatus const.
UserStatus const.
UserStatus const.
UserStatus const.

# 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.
GroupCreateObject struct used for groups create operations.
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.
GroupUpdateObject struct used for groups update operations.
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.
IssueCreateObject struct used for issues create operations.
IssueGetRequestFilters contains data for making issues get request.
IssueGetRequestFiltersCf contains data for making issues get request.
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.
IssueUpdateObject struct used for issues update operations.
MembershipAddObject struct used for project memberships add operations.
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.
MembershipUpdateObject struct used for project memberships update operations.
ProjectAllGetRequest contains data for making request to get all projects satisfying specified filters.
ProjectCreateObject struct used for projects create operations.
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.
ProjectUpdateObject struct used for projects update operations.
TrackerObject struct used for trackers get operations.
UserAllGetRequest contains data for making request to get all users satisfying specified filters.
UserCreateObject struct used for users create operations.
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.
UserUpdateObject struct used for users update operations.

# Type aliases

ProjectStatus defines project status type.
UserNotification defines user notification type.
UserStatus defines user status type.