network

package
v0.0.0-...-05e9a1c Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResponseStatus

func CheckResponseStatus(resp *http.Response, endpoint string, serverErrorKind app.ErrorKind) error

func ConvertResponseError

func ConvertResponseError(err error, serverErrorKind app.ErrorKind) error

func ListArtifacts

func ListArtifacts(client *http.Client, ktorVersion string) ([]string, error)

func NewProject

func NewProject(client *http.Client, payload ProjectPayload, ctx context.Context) ([]byte, error)

func SearchArtifacts

func SearchArtifacts(client *http.Client, ktorVersion string, searches []string) (map[string][]Artifact, error)

Types

type Artifact

type Artifact struct {
	Name     string `json:"artifact"`
	Group    string `json:"group"`
	IsTest   bool   `json:"isTest"`
	Distance int    `json:"distance"`
}

type BuildSystemArgs

type BuildSystemArgs string
const VersionCatalogBuildArg BuildSystemArgs = "version_catalog"

type DefaultSettings

type DefaultSettings struct {
	ProjectName    StringParam `json:"project_name"`
	CompanyWebsite StringParam `json:"company_website"`
	Engine         EnumParam   `json:"engine"`
	KtorVersion    EnumParam   `json:"ktor_version"`
	KotlinVersion  EnumParam   `json:"kotlin_version"`
	BuildSystem    EnumParam   `json:"build_system"`
	ConfigType     EnumParam   `json:"configuration_in"`
}

func FetchSettings

func FetchSettings(client *http.Client) (*DefaultSettings, error)

type EnumOption

type EnumOption struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type EnumParam

type EnumParam struct {
	Options   []EnumOption `json:"options"`
	DefaultId string       `json:"default_id"`
}

type NotSupportedKtorVersion

type NotSupportedKtorVersion struct {
	Version string
}

func (NotSupportedKtorVersion) Error

func (e NotSupportedKtorVersion) Error() string

type Plugin

type Plugin struct {
	Id              string   `json:"xmlId"`
	Name            string   `json:"name"`
	Group           string   `json:"group"`
	Description     string   `json:"description"`
	RequiredPlugins []string `json:"requiredFeatures"`
}

func FetchPlugins

func FetchPlugins(client *http.Client, ktorVersion string, ctx context.Context) ([]Plugin, error)

type ProjectPayload

type ProjectPayload struct {
	Settings      ProjectSettings `json:"settings"`
	Plugins       []string        `json:"features"`
	HasSampleCode bool            `json:"addDefaultRoutes"`
	ConfigType    string          `json:"configurationOption"`
	HasWrapper    bool            `json:"addWrapper"`
}

type ProjectSettings

type ProjectSettings struct {
	Name            string                     `json:"project_name"`
	CompanyWebsite  string                     `json:"company_website"`
	Engine          string                     `json:"engine"`
	BuildSystem     string                     `json:"build_system"`
	KtorVersion     string                     `json:"ktor_version"`
	KotlinVersion   string                     `json:"kotlin_version"`
	BuildSystemArgs map[BuildSystemArgs]string `json:"build_system_args"`
}

type StringParam

type StringParam struct {
	DefaultVal string `json:"default"`
}

Jump to

Keyboard shortcuts

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