client

package
v0.0.17 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(logger log.Logger, credPath string) (*Client, error)

func (*Client) Request

func (c *Client) Request(method string, path string, body io.Reader, authenticated bool) (*http.Response, error)

func (*Client) Submission

func (c *Client) Submission(id int) (*Submission, error)

func (*Client) Submit

func (c *Client) Submit(submission *Submission) (int, error)

func (*Client) Token

func (c *Client) Token(username, password string) (string, error)

func (*Client) User

func (c *Client) User() (*UserResponse, error)

type ErrForbidden

type ErrForbidden Error

type Error added in v0.0.14

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

type Manifest

type Manifest struct {
	Image      string            `yaml:"image" json:"image"`
	Mode       Mode              `yaml:"mode" json:"mode"`
	Difficulty string            `yaml:"difficulty,omitempty" json:"difficulty,omitempty"`
	Command    []string          `yaml:"command,omitempty" json:"command,omitempty"`
	Args       []string          `yaml:"args,omitempty" json:"args,omitempty"`
	Env        map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
	Sources    map[string]string `yaml:"sources,omitempty" json:"sources,omitempty"`
}

func ManifestFromPath

func ManifestFromPath(path string) (*Manifest, error)

type Mode

type Mode string

Mode Enum

const (
	ModeAIvsCOM Mode = "AIvsCOM"

	API = "https://api.diambra.ai/api/v1alpha1"
)

type Submission

type Submission struct {
	Manifest Manifest          `yaml:"manifest" json:"manifest"`
	Secrets  map[string]string `yaml:"secrets,omitempty" json:"secrets,omitempty"`
}

type TokenRequest

type TokenRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
}

type UserResponse

type UserResponse struct {
	ID       int    `json:"id"`
	Username string `json:"username"`
}

Jump to

Keyboard shortcuts

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