jira

package
v0.0.0-...-763fb9f Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(opts *ClientOpts) *Client

func (*Client) GetIssue

func (c *Client) GetIssue(key string) (*Issue, error)

type ClientOpts

type ClientOpts struct {
	BaseURL   string
	UserEmail string
	APIToken  string
	Timeout   time.Duration
}

type Config

type Config struct {
	Host      string
	UserEmail string `json:"user_email"`
	APIToken  string `json:"api_token"`
	Timeout   *time.Duration
}

Config struct for storing JSON data file

func GetConfig

func GetConfig() (*Config, error)

GetConfig reads the config file from the possible locations and then returns a pointer to a new config object.

func (Config) String

func (c Config) String() string

type Issue

type Issue struct {
	ID     string `json:"id"`
	Key    string `json:"key"`
	Self   string `json:"self"`
	Fields struct {
		Description string `json:"description"`
		Summary     string `json:"summmary"`
	} `json:"fields"`
}

Issue is a struct representing a JIRA issue.

func ParseIssue

func ParseIssue(key string) (*Issue, error)

ParseIssue tries to parse a JIRA key from a string. If it is able to, it returns a pointer to the issue otherwise the issue is nil and error will be populated

func (Issue) String

func (i Issue) String() string

func (Issue) URL

func (i Issue) URL(h string) string

URL returns the URL for the JIRA issue

Jump to

Keyboard shortcuts

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