api

package
v0.0.0-...-c1cb169 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResult

type APIResult struct {
	Success bool             `json:"success"`
	Message string           `json:"message"`
	Data    *json.RawMessage `json:"data"`
}

type Challenge

type Challenge struct {
	ID          uint   `json:"id,omitempty"`
	Type        string `json:"type"`
	Name        string `json:"name"`
	Category    string `json:"category"`
	Description string `json:"description"`
	Value       int    `json:"value"`
	State       string `json:"state,omitempty"`
	MaxAttempts uint   `json:"max_attempts,omitempty"`
}

type Client

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

func (*Client) CreateChallenge

func (client *Client) CreateChallenge(chal Challenge) (result Challenge, err error)

func (*Client) CreateFile

func (client *Client) CreateFile(file FileSpec) (result []File, err error)

func (*Client) CreateFlag

func (client *Client) CreateFlag(flag Flag) (result Flag, err error)

func (*Client) DeleteChallenge

func (client *Client) DeleteChallenge(chal uint) (err error)

func (*Client) DeleteFile

func (client *Client) DeleteFile(file uint) (err error)

func (*Client) DeleteFlag

func (client *Client) DeleteFlag(flag uint) (err error)

func (*Client) GetChallenge

func (client *Client) GetChallenge(chal uint) (result Challenge, err error)

func (*Client) GetFile

func (client *Client) GetFile(file uint) (result File, err error)

func (*Client) GetFlag

func (client *Client) GetFlag(flag uint) (result Flag, err error)

func (*Client) Init

func (client *Client) Init() (err error)

func (*Client) ListChallengeFiles

func (client *Client) ListChallengeFiles(chal uint) (result []File, err error)

func (*Client) ListChallengeFlags

func (client *Client) ListChallengeFlags(chal uint) (result []Flag, err error)

func (*Client) ListChallenges

func (client *Client) ListChallenges() (result []Challenge, err error)

func (*Client) ListFiles

func (client *Client) ListFiles() (result []File, err error)

func (*Client) ListFlags

func (client *Client) ListFlags() (result []Flag, err error)

func (*Client) ModifyChallenge

func (client *Client) ModifyChallenge(chal Challenge) (result Challenge, err error)

func (*Client) ModifyFlag

func (client *Client) ModifyFlag(flag Flag) (result Flag, err error)

type Config

type Config struct {
	Username string
	Password string
	URL      string
}

func (Config) Client

func (config Config) Client() Client

type File

type File struct {
	ID       uint   `json:"id,omitempty"`
	Type     string `json:"type"`
	Location string `json:"location"`
}

type FileSpec

type FileSpec struct {
	Type      string   `multipart:"type"`
	Challenge uint     `multipart:"challenge"`
	File      *os.File `multipart:"file"`
}

type Flag

type Flag struct {
	ID        uint   `json:"id,omitempty"`
	Challenge uint   `json:"challenge"`
	Type      string `json:"type"`
	Content   string `json:"content"`
	Options   string `json:"data,omitempty"` // NOTE: should be "" or "case_insensitive"
}

Jump to

Keyboard shortcuts

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