config

package
v3.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPath

func GetPath() (string, error)

GetPath get the configuration file path.

func Save

func Save(configs []Configuration) error

Save saves the configuration into a file.

Types

type Configuration

type Configuration struct {
	PullRequests map[string][]types.PullRequest `json:"pull_requests,omitempty"`
	Directory    string                         `json:"directory,omitempty"`
	BaseRemote   string                         `json:"base_remote,omitempty"`
	MainBranch   string                         `json:"main_branch,omitempty"`
}

Configuration is the global application configuration model.

func Find

func Find(configurations []Configuration, directory string) (*Configuration, error)

Find finds a configuration by directory name.

func Get

func Get() (*Configuration, error)

Get configuration for the current directory.

func ReadFile

func ReadFile() ([]Configuration, error)

ReadFile reads or creates the configuration file and load the configuration into an array.

func (*Configuration) FindPullRequests

func (c *Configuration) FindPullRequests(number int) (*types.PullRequest, error)

FindPullRequests finds a pull request by number.

func (*Configuration) RemovePullRequest

func (c *Configuration) RemovePullRequest(pull *types.PullRequest) int

RemovePullRequest removes a pull request.

Jump to

Keyboard shortcuts

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