projects

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package projects provides a client for managing Redmine projects.

Package projects provides commands for managing Redmine projects.

Package projects provides types for managing Redmine projects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(flags *types.GlobalFlags, resolver types.Resolver) *cobra.Command

NewCommand creates a new projects command.

Types

type Client

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

Client is a client for managing Redmine projects.

func NewClient

func NewClient(c *client.Client) *Client

NewClient creates a new projects client.

func (*Client) Create

func (c *Client) Create(ctx context.Context, req *ProjectCreateRequest) (*Project, error)

Create creates a new project.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, id int) error

Delete deletes a project.

func (*Client) Get

func (c *Client) Get(ctx context.Context, id int, params map[string]string) (*Project, error)

Get retrieves a project by ID.

func (*Client) GetByIdentifier

func (c *Client) GetByIdentifier(ctx context.Context, identifier string, params map[string]string) (*Project, error)

GetByIdentifier retrieves a project by identifier.

func (*Client) List

func (c *Client) List(ctx context.Context, params map[string]string) (*ProjectList, error)

List retrieves projects based on the provided parameters.

func (*Client) Update

func (c *Client) Update(ctx context.Context, id int, req *ProjectUpdateRequest) error

Update updates an existing project.

type Project

type Project struct {
	ID              int         `json:"id"`
	Name            string      `json:"name"`
	Identifier      string      `json:"identifier"`
	Description     string      `json:"description"`
	Homepage        string      `json:"homepage"`
	Status          int         `json:"status"`
	Parent          *Reference  `json:"parent,omitempty"`
	CreatedOn       *time.Time  `json:"created_on,omitempty"`
	UpdatedOn       *time.Time  `json:"updated_on,omitempty"`
	Trackers        []Reference `json:"trackers,omitempty"`
	IssueCategories []Reference `json:"issue_categories,omitempty"`
	EnabledModules  []Reference `json:"enabled_modules,omitempty"`
}

Project represents a Redmine project.

type ProjectCreateRequest

type ProjectCreateRequest struct {
	Name           string `json:"name,omitempty"`
	Identifier     string `json:"identifier,omitempty"`
	Description    string `json:"description,omitempty"`
	Homepage       string `json:"homepage,omitempty"`
	IsPublic       bool   `json:"is_public,omitempty"`
	ParentID       int    `json:"parent_id,omitempty"`
	InheritMembers bool   `json:"inherit_members,omitempty"`
}

ProjectCreateRequest represents a request to create a project.

type ProjectList

type ProjectList struct {
	Projects   []Project `json:"projects"`
	TotalCount int       `json:"total_count"`
	Limit      int       `json:"limit"`
	Offset     int       `json:"offset"`
}

ProjectList represents a list of projects with pagination info.

type ProjectUpdateRequest

type ProjectUpdateRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Homepage    string `json:"homepage,omitempty"`
	Status      int    `json:"status,omitempty"`
}

ProjectUpdateRequest represents a request to update a project.

type Reference

type Reference struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

Reference represents a reference to another Redmine entity.

Jump to

Keyboard shortcuts

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