apiclient

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient

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

func NewClient

func NewClient() ApiClient

func (ApiClient) Get

func (clt ApiClient) Get(url string) (resp *http.Response, err error)

func (ApiClient) GetPublishers

func (c ApiClient) GetPublishers() ([]common.Publisher, error)

GetPublishers returns a slice with all the publishers from the API and any error encountered.

func (ApiClient) GetSoftwareByURL

func (c ApiClient) GetSoftwareByURL(url string) (*Software, error)

GetSoftwareByURL returns the software matching the given repo URL and any error encountered.

func (ApiClient) Patch

func (clt ApiClient) Patch(url string, body []byte) (resp *http.Response, err error)

func (ApiClient) PatchSoftware

func (c ApiClient) PatchSoftware(id string, url string, aliases []string, publiccodeYml string) (*http.Response, error)

PatchSoftware updates a software resource with the given fields and returns an http.Response and any error encountered.

func (ApiClient) Post

func (clt ApiClient) Post(url string, body []byte) (resp *http.Response, err error)

func (ApiClient) PostLog

func (c ApiClient) PostLog(message string) (*http.Response, error)

PostLog creates a new log with the given message and returns an http.Response and any error encountered.

func (ApiClient) PostSoftware

func (c ApiClient) PostSoftware(url string, aliases []string, publiccodeYml string) (*http.Response, error)

PostSoftware creates a new software resource with the given fields and returns an http.Response and any error encountered.

func (ApiClient) PostSoftwareLog

func (c ApiClient) PostSoftwareLog(softwareId string, message string) (*http.Response, error)

PostSoftwareLog creates a new software log with the given fields and returns an http.Response and any error encountered.

type CodeHosting

type CodeHosting struct {
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	Group     bool      `json:"group"`
	URL       string    `json:"url"`
}
type Links struct {
	Prev string `json:"prev"`
	Next string `json:"next"`
}

type Publisher

type Publisher struct {
	ID            string        `json:"id"`
	AlternativeID string        `json:"alternativeId"`
	Email         string        `json:"email"`
	Description   string        `json:"description"`
	CodeHostings  []CodeHosting `json:"codeHosting"`
	Active        bool          `json:"active"`
	CreatedAt     time.Time     `json:"createdAt"`
	UpdatedAt     time.Time     `json:"updatedAt"`
}

type PublishersPaginated

type PublishersPaginated struct {
	Data  []Publisher `json:"data"`
	Links Links       `json:"links"`
}

type Software

type Software struct {
	ID            string    `json:"id"`
	URL           string    `json:"url"`
	Aliases       []string  `json:"aliases"`
	PubliccodeYml string    `json:"publiccodeYml"`
	Active        bool      `json:"active"`
	CreatedAt     time.Time `json:"createdAt"`
	UpdatedAt     time.Time `json:"updatedAt"`
}

type SoftwarePaginated

type SoftwarePaginated struct {
	Data  []Software `json:"data"`
	Links Links      `json:"links"`
}

Jump to

Keyboard shortcuts

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