api

package
v0.0.0-...-5f64a73 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	APIUrl = "https://api.pathwar.net"
)

Functions

This section is empty.

Types

type APIPathwar

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

func NewAPIPathwar

func NewAPIPathwar(token, debug string) *APIPathwar

func (*APIPathwar) DeleteRequest

func (p *APIPathwar) DeleteRequest(url, etag string) ([]byte, error)

func (*APIPathwar) GetRawLevelInstance

func (p *APIPathwar) GetRawLevelInstance(rawLevelInstanceID string) (*RawLevelInstance, error)

func (*APIPathwar) GetRawLevelInstanceUsers

func (p *APIPathwar) GetRawLevelInstanceUsers(where interface{}) (*RawLevelInstanceUsers, error)

func (*APIPathwar) GetRawLevelInstances

func (p *APIPathwar) GetRawLevelInstances(where interface{}) (*RawLevelInstances, error)

func (*APIPathwar) GetRawOrganizationUsers

func (p *APIPathwar) GetRawOrganizationUsers(where interface{}) (*RawOrganizationUsers, error)

func (*APIPathwar) GetRequest

func (p *APIPathwar) GetRequest(url string) ([]byte, error)

func (*APIPathwar) GetUser

func (p *APIPathwar) GetUser(userID string) (*User, error)

func (*APIPathwar) GetUsers

func (p *APIPathwar) GetUsers(where interface{}) (*Users, error)

func (*APIPathwar) PatchRequest

func (p *APIPathwar) PatchRequest(url, etag string, data interface{}) ([]byte, error)

func (*APIPathwar) PostRequest

func (p *APIPathwar) PostRequest(url string, data interface{}) ([]byte, error)
type Link struct {
	Href  string `json:"href",omitempty`
	Title string `json:"title",omitempty`
}

type Meta

type Meta struct {
	MaxResults int `json:"max_results",omitempty`
	Page       int `json:"page",omitempty`
	Total      int `json:"total",omitempty`
}

type PathwarGenerateAToken

type PathwarGenerateAToken struct {
	ID      string `json:"_id"`
	Created string `json:"_created"`
	Etag    string `json:"_etag"`
	Status  string `json:"_status"`
}

func GenerateAToken

func GenerateAToken(login, password string, tmp bool) (*PathwarGenerateAToken, error)

type PathwarToken

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

func GetToken

func GetToken(login, password, id string) (*PathwarToken, error)

type RawLevelInstance

type RawLevelInstance struct {
	StdItem

	Active      bool   `json:"active"`
	Level       string `json:"level"`
	Name        string `json:"name"`
	PwnStatus   string `json:"pwn_status"`
	Passphrases []struct {
		Value string `json:"value"`
		Key   string `json:"key"`
	} `json:"passphrases"`
	PrivateUrls []struct {
		Url  string `json:"url"`
		Name string `json:"name"`
	} `json:"private_urls"`
	Urls []struct {
		Url  string `json:"url"`
		Name string `json:"name"`
	}
}

type RawLevelInstanceUser

type RawLevelInstanceUser struct {
	StdItem

	ExpiryDate        string `json:"expiry_date"`
	Hash              string `json:"hash"`
	Level             string `json:"level"`
	LevelInstance     string `json:"level_instance"`
	Organization      string `json:"organization"`
	OrganizationLevel string `json:"organization_level"`
	User              string `json:"user"`
}

type RawLevelInstanceUsers

type RawLevelInstanceUsers struct {
	StdList

	Items []RawLevelInstanceUser `json:"_items"`
}

type RawLevelInstances

type RawLevelInstances struct {
	StdList

	Items []RawLevelInstance `json:"_items"`
}

type RawOrganizationUser

type RawOrganizationUser struct {
	StdItem

	Role         string `json:"role"`
	User         string `json:"user"`
	Organization string `json:"organization"`
}

type RawOrganizationUsers

type RawOrganizationUsers struct {
	StdList

	Items []RawOrganizationUser `json:"_items"`
}

type StdItem

type StdItem struct {
	Id            string          `json:"_id",omitempty`
	Created       string          `json:"_created",omitempty`
	Etag          string          `json:"_etag",omitempty`
	Links         map[string]Link `json:"_links",omitempty`
	SchemaVersion int             `json:"_schema_version",omitempty`
	Updated       string          `json:"_updated",omitempty`
}

type StdList

type StdList struct {
	Links map[string]Link `json:"_links",omitempty`
	Meta  Meta            `json:"_meta",omitempty`
}

type User

type User struct {
	StdItem

	Company       string `json:"company"`
	GithubHandle  string `json:"github_handle"`
	GravatarHash  string `json:"gravatar_hash"`
	Location      string `json:"location"`
	Login         string `json:"login"`
	Name          string `json:"name"`
	Role          string `json:"role"`
	TwitterHandle string `json:"twitter_handle"`
	Website       string `json:"website"`
}

type Users

type Users struct {
	StdList

	Items []User `json:"_items"`
}

Jump to

Keyboard shortcuts

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