Code Monkey home page Code Monkey logo

go-redmine's Introduction

go-redmine

Intefaces to redmine.

Module Install

go get github.com/mattn/go-redmine 

APIs

Provide Interfaces to redmine APIs.

API Implements
Issues 100%
Projects 100%
Project Memberships 100%
Users 0%
Time Entries 100%
News 100%
Issue Relations 100%
Versions 100%
Wiki Pages 100%
Queries 0%
Attachments 0%
Issue Statuses 100%
Trackers 100%
Enumerations 100%
Issue Categories 100%
Roles 100%
Groups 0%

Godmine

Provide command line tool for redmine.

Install

go install github.com/mattn/go-redmine/cmd/godmine@latest

Usage

godmine <command> <subcommand> [arguments]

Project Commands:
  add      a create project with text editor.
             $ godmine p a

  create   c create project from given arguments.
             $ godmine p c name identifier description

  update   u update given project.
             $ godmine p u 1

  show     s show given project.
             $ godmine p s 1

  delete   d delete given project.
             $ godmine p d 1

  list     l listing projects.
             $ godmine p l

Issue Commands:
  add      a create issue with text editor.
             $ godmine i a

  create   c create issue from given arguments.
             $ godmine i c subject description

  update   u update given issue.
             $ godmine i u 1

  show     s show given issue.
             $ godmine i s 1

  delete   d delete given issue.
             $ godmine i d 1

  close    x close given issue.
             $ godmine i x 1

  notes    n add notes to given issue.
             $ godmine i n 1

  list     l listing issues.
             $ godmine i l

Settings

To use this, you should create settings.json in:

UNIX:

~/.config/godmine/settings.json

WINDOWS:

%APPDATA%\godmine/settings.json

Write following:

{
	"endpoint": "http://redmine.example.com",
	"apikey": "YOUR-API-KEY",
	"project": 1 // default project id
}

If you want switching configuration file, you should use GODMINE_ENV environment variable. If you set GODMINE_ENV to mine, godmine use settings.mine.json to configuration file.

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)

go-redmine's People

Contributors

andrzejressel avatar cburkert avatar czoig avatar d-led avatar danilkharlamov avatar getgot78 avatar gostmair avatar jazby avatar kaneshin avatar kawaken avatar kuwa72 avatar m4ng0 avatar mattn avatar mephistophiles avatar minchao avatar monaka avatar motemen avatar nise-nabe avatar oiljin avatar omochice avatar robvdl avatar szaffarano avatar tbaud0n avatar uphy avatar yuta-masano avatar zztkm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

go-redmine's Issues

TimeEntry hours - json skipped

type TimeEntry struct
...
Hours float32
...

but must be

Hours float32 json:"hours"``

Without this changes TimeEntry modification does not work properly.
PS: may be it was planned and I miss something in yours API

Projects list

Hello!
I looked your code for listing projects, and, if i understand correct, you don't check, if number of projects is more than limit (default or set in const).
I looked in
godmine/main.go#L456
and
project.go#L58
but didn't find any checks, like in issues:
issue.go#L369

I hope i wrong, correct me if yes.

Have a good day!

resource filter

Thank you for creating this great Redmine interface!

The API supports optional filter, example for users, which is helpful when dealing / looking up in a system with 1000s of users. This support is missing

Before creating or requesting a PR, the question is would you be in favor of strongly typing all possible filter clauses or just extend the methods with variadic filter string support?

Example idea:

func (c *Client) Users(f ...Filter) ([]User, error) {}

So one could call

c.Users()
c.Users(Filter{"name": "JDoe", "status": "2"})

I'd suggest variadic parameters as it keeps backward compatibility and is Redmine version agnostic

Lack of filtering options when fetching issues for example

I need to fetch issues but apply some filters, for example status_id=* to get all stories including closed ones.

I was looking at the Issues() function and it doesn't really provide ways to pass in extra query params for filtering, which is sorely needed or I have to fetch everyting... a page at a time and filter over the results in Go.

I need this for a project now, so going to implement it all in a fork and see how it turns out.

License?

Hello! Thank you for this project but could you specify the license :)

Personally I prefer GPLv3 for important projects and WTFPL2 for non-important projects.

Open editor with arguments

Thank you for great application.

My RedMine supports markdown.
So I want to open editor with filetype setting like: vim -c "set filetype=markdown".

Add license file

I am currently unable to find the documentation for mattn/go-redmine at pkg.go.dev.
This seems to be due to the fact that the repository does not contain the license file.

Perhaps if you could add the license file, we will be able to check the package documentation on the web.

It would be great if you could support this.

refs:

More documentation?

I was looking to use godmine for building a custom workflow for things I do, but I'm new to Go. Is there any documentation on how to make this thing work for a newbie to this?

Thanks!

vet issue due to invalid struct tag in News struct

struct field tag json:created_on not compatible with reflect.StructTag.Get: bad syntax for struct tag value (vet)

It's missing quotes " around created_on.

Also same problem with a few fields on the Project struct.

Also TimeEntry has a typo for the SpentOn field and uses the wrong JSON field name:

SpentOn string json:"created_on"

start_date doesn't exist in Issue struct

There's start_date in the response of issue API, but not in Issue struct.

$ curl http://localhost:8080/issues/23.json?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
{"issue":{"id":23,"project":{"id":1,"name":"testproject"},"tracker":{"id":4,"name":"Docs"},"status":{"id":1,"name":"New"},"priority":{"id":2,"name":"Normal"},"author":{"id":1,"name":"Redmine Admin"},"subject":"chapter1","description":"chapter1aa","start_date":"2018-08-20","due_date":"2018-08-25","done_ratio":0,"spent_hours":0.0,"total_spent_hours":0.0,"created_on":"2018-07-17T08:25:09Z","updated_on":"2018-07-17T08:36:42Z"}}

tracker with https

tracker.go 15th line
res, err := http.Get(c.endpoint + "/trackers.json?key=" + c.apikey + c.getPaginationClause())
’http.Get‘ should be ‘c.Get'

it happend on when i want to connect to https local server without certificate

PUT Response status code 204 treated as error

Hi!
After making PUT request, response status code is 204 (no content), which is valid response, but go-redmine treats it as error and tries decode content body which is empty string.
Here it is:

if res.StatusCode != 200 {

In Redmine docs there are some pages that describes 204 code as confirmation that requested change was made:
https://www.redmine.org/projects/redmine/wiki/Rest_IssueCategories#PUT
https://www.redmine.org/projects/redmine/wiki/Rest_Memberships#PUT
https://www.redmine.org/projects/redmine/wiki/Rest_TimeEntries#Updating-a-time-entry
etc.

export redmine.client

I need to use it and it isn't exported, can we please export this as Client please.

close and delete ticket doesn't work.

ticket is valid and can be deleted via redmine.
~/go-redmine/godmine$ ./godmine i d 104
Failed to delete issue: invalid character '<' looking for beginning of value

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.