core

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const GITHUB_LICENSE_BASE_URL = "https://api.github.com/licenses"
View Source
const GOPM_CONFIG_FILE = "gopm.json"

Name of the gopm file used by the CLI

View Source
const LICENSE_FILE = "LICENSE.txt"

Variables

This section is empty.

Functions

func ExportConfig

func ExportConfig(config GoPMConfig, configPath string) error

Export the configuration in a file

func ExportLicense

func ExportLicense(projectName, licenseContent string) error

Export the license in a file

func FetchLicense

func FetchLicense(name string) (string, error)

Types

type GoPMConfig

type GoPMConfig struct {
	Author       string            `json:"author"`       // Author of the project
	Description  string            `json:"description"`  // Description of the project
	Version      string            `json:"version"`      // version of the project
	EntryPoint   string            `json:"entry"`        // entry point of the project (e.g main.go)
	License      string            `json:"license"`      // Licence of the project
	Scripts      map[string]string `json:"scripts"`      // Map of scripts that can be used
	ProjectName  string            `json:"name"`         // Name of the project
	Git          string            `json:"git"`          // Git repository name
	Dependencies map[string]string `json:"dependencies"` // Dependencies of the project
}

Defines the content of the gopm.json. This config will be used to store the different information about the current go project

func NewGoPMConfig

func NewGoPMConfig() *GoPMConfig

Create an empty configuration

func ReadConfig

func ReadConfig() (*GoPMConfig, error)

Read the gopm configuration from a file

type License

type License struct {
	Key  string `json:"key"`
	Name string `json:"name"`
	Body string `json:"body"`
}

Response JSON from the Github API for retrieving licence templates

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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