restclient

package
v0.0.0-...-2be5db1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MassdriverBaseURL = "https://api.massdriver.cloud"

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type MassdriverClient

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

func NewClient

func NewClient() *MassdriverClient

func (*MassdriverClient) Do

func (c *MassdriverClient) Do(ctx *context.Context, req *Request) (*http.Response, error)

func (*MassdriverClient) PublishBundle

func (c *MassdriverClient) PublishBundle(request PublishPost) (string, error)

func (*MassdriverClient) WithAPIKey

func (c *MassdriverClient) WithAPIKey(apiKey string) *MassdriverClient

func (*MassdriverClient) WithBaseURL

func (c *MassdriverClient) WithBaseURL(endpoint string) *MassdriverClient

type PublishPost

type PublishPost struct {
	Name              string                 `json:"name"`
	Description       string                 `json:"description"`
	Type              string                 `json:"type"`
	SourceURL         string                 `json:"source_url"`
	Access            string                 `json:"access"`
	ArtifactsSchema   map[string]interface{} `json:"artifacts_schema"`
	ConnectionsSchema map[string]interface{} `json:"connections_schema"`
	ParamsSchema      map[string]interface{} `json:"params_schema"`
	UISchema          map[string]interface{} `json:"ui_schema"`
	OperatorGuide     []byte                 `json:"operator_guide,omitempty"`
	AppSpec           map[string]interface{} `json:"app,omitempty"`
	Spec              map[string]interface{} `json:"spec,omitempty"`
}

type PublishResponse

type PublishResponse struct {
	UploadLocation string `json:"upload_location"`
}

type Request

type Request struct {
	Method string
	Path   string
	Body   io.Reader
}

func NewRequest

func NewRequest(method string, path string, body io.Reader) *Request

func (*Request) ToHTTPRequest

func (req *Request) ToHTTPRequest(ctx context.Context, c *MassdriverClient) (*http.Request, error)

Jump to

Keyboard shortcuts

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