api

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDateTime

func ParseDateTime(input string) (time.Time, error)

Types

type Client

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

func New

func New(authToken string) *Client

func (*Client) Auth added in v0.0.10

func (c *Client) Auth() string

func (*Client) UploadCodex

type CodexParseError

type CodexParseError struct {
	// The type of the error
	Error          string `json:"error"`
	Message        string `json:"message"`
	SourcePosition string `json:"sourcePosition"`
	SourceInfo     struct {
		SourceContext struct {
			Lines []string `json:"lines"`
		} `json:"sourceContext"`
	} `json:"sourceInfo"`
}

type CodexParseFailedError

type CodexParseFailedError struct {
	Errors []CodexParseError `json:"errors"`
}

func (*CodexParseFailedError) Error

func (e *CodexParseFailedError) Error() string

type ErrorResponse

type ErrorResponse struct {
	Error   string          `json:"error"`
	Message string          `json:"message"`
	Details json.RawMessage `json:"details"`
}

A generic error returned by the API Consumers can inspect the value of `Error` and unmarshall `Details` as appropriate.

func (*ErrorResponse) String

func (r *ErrorResponse) String() string

func (*ErrorResponse) Verbose

func (r *ErrorResponse) Verbose() string

type FileRef

type FileRef struct {
	// The name of the file that will be uploaded.
	// This is usually not the path to the file on the disk, but rather,
	// the path relative to the directory that's being uploaded.
	// For example, if we have a directory structure like this:
	//   $HOME/
	//     foo/
	//	     bar.txt
	//       spam/
	//         eggs.txt
	// then if we're uploading $HOME/foo, our files would have names
	// "bar.txt" and "spam/eggs.txt".
	Name string

	// The path to the file on disk (that will be read as part of the upload)
	FsPath string
}

type KernelOptions added in v0.0.12

type KernelOptions struct {
	SystemPackages []string `json:"systemPackages,omitempty"`
}

type StatusError

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

func (StatusError) Description

func (s StatusError) Description() string

func (StatusError) Error

func (s StatusError) Error() string

type UploadCodexRequest

type UploadCodexRequest struct {
	// required
	// the codex category that the uploaded codex should belong to
	CodexCategoryId string `json:"codexCategoryId"`

	// required
	// the files that comprise the codex bundle
	Files []FileRef `json:"-"`

	// optional
	// if specified, replace this codex instead of uploading a new codex
	CodexId string `json:"replaceCodexId,omitempty"`

	KernelOptions KernelOptions `json:"kernelOptions"`
}

type UploadCodexResponse

type UploadCodexResponse struct {
	CodexId string `json:"codexId"`
}

Jump to

Keyboard shortcuts

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