api

package
v0.24.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfigProperties added in v0.4.0

type AppConfigProperties map[string]string

func ReadPropertiesFile added in v0.4.0

func ReadPropertiesFile(filename string) (AppConfigProperties, error)

type Client

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

func NewClient

func NewClient(config Config) (*Client, error)

func (*Client) Address

func (c *Client) Address() string

func (*Client) HttpPOST

func (c *Client) HttpPOST(path string, jsonStr *bytes.Buffer) (*http.Response, error)

func (*Client) IngestTokens

func (c *Client) IngestTokens() *IngestTokens

func (*Client) Licenses added in v0.12.0

func (c *Client) Licenses() *Licenses

func (*Client) Mutate

func (c *Client) Mutate(mutation interface{}, variables map[string]interface{}) error

func (*Client) Parsers

func (c *Client) Parsers() *Parsers

func (*Client) Query

func (c *Client) Query(query interface{}, variables map[string]interface{}) error

func (*Client) Repositories added in v0.13.0

func (c *Client) Repositories() *Repositories

func (*Client) Status added in v0.4.0

func (c *Client) Status() (*StatusResponse, error)

func (*Client) Token

func (c *Client) Token() string

func (*Client) Users

func (c *Client) Users() *Users

func (*Client) Viewer added in v0.4.0

func (c *Client) Viewer() *Viewer

func (*Client) Views added in v0.5.0

func (c *Client) Views() *Views

type Config

type Config struct {
	Address string
	Token   string
}

func DefaultConfig

func DefaultConfig() Config

type IngestToken

type IngestToken struct {
	Name           string `json:"name"`
	Token          string `json:"token"`
	AssignedParser string `json:"parser"`
}

type IngestTokens

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

func (*IngestTokens) Add

func (p *IngestTokens) Add(repo string, name string, parserName string) (*IngestToken, error)

func (*IngestTokens) List

func (p *IngestTokens) List(repo string) ([]IngestToken, error)

func (*IngestTokens) Remove

func (p *IngestTokens) Remove(repo string, tokenName string) error

type License added in v0.9.0

type License interface {
	ExpiresAt() string
	IssuedAt() string
	LicenseType() string
}

type Licenses added in v0.12.0

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

func (*Licenses) Get added in v0.12.0

func (c *Licenses) Get() (License, error)

func (*Licenses) Install added in v0.12.0

func (p *Licenses) Install(license string) error

type OnPremLicense added in v0.12.0

type OnPremLicense struct {
	ID            string
	ExpiresAtVal  string
	IssuedAtVal   string
	IssuedTo      string
	NumberOfSeats int
}

func (OnPremLicense) ExpiresAt added in v0.12.0

func (l OnPremLicense) ExpiresAt() string

func (OnPremLicense) IssuedAt added in v0.12.0

func (l OnPremLicense) IssuedAt() string

func (OnPremLicense) LicenseType added in v0.12.0

func (l OnPremLicense) LicenseType() string

type Parser

type Parser struct {
	Name        string
	Description string           `yaml:",omitempty"`
	Tests       []ParserTestCase `yaml:",omitempty"`
	Example     string           `yaml:",omitempty"`
	Script      string           `yaml:",flow"`
	TagFields   []string         `yaml:",omitempty"`
}

type ParserListItem

type ParserListItem struct {
	Name      string
	IsBuiltIn bool
}

type ParserTestCase

type ParserTestCase struct {
	Input  string
	Output map[string]string
}

type Parsers

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

func (*Parsers) Add

func (p *Parsers) Add(reposistoryName string, parser *Parser, force bool) error

func (*Parsers) Get

func (p *Parsers) Get(reposistoryName string, parserName string) (*Parser, error)

func (*Parsers) List

func (p *Parsers) List(reposistoryName string) ([]ParserListItem, error)

func (*Parsers) Remove

func (p *Parsers) Remove(reposistoryName string, parserName string) error

type RepoListItem added in v0.13.0

type RepoListItem struct {
	Name      string
	SpaceUsed int64 `graphql:"compressedByteSize"`
}

type Repositories added in v0.13.0

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

func (*Repositories) Create added in v0.24.0

func (c *Repositories) Create(name string) error

func (*Repositories) Get added in v0.13.0

func (c *Repositories) Get(name string) (Repository, error)

func (*Repositories) List added in v0.13.0

func (c *Repositories) List() ([]RepoListItem, error)

type Repository added in v0.13.0

type Repository struct {
	Name            string
	RetentionDays   int64 `graphql:"timeBasedRetention"`
	RetentionSizeGB int64 `graphql:"storageSizeBasedRetention"`
	SpaceUsed       int64 `graphql:"compressedByteSize"`
}

type Role added in v0.5.0

type Role struct {
	Name string
}

type RolePermission added in v0.5.0

type RolePermission struct {
	Role struct {
		Name string
	}
	View struct {
		Name string
	}
	QueryPrefix string
}

type StatusResponse added in v0.4.0

type StatusResponse struct {
	Status  string
	Version string
}

type TrialLicense added in v0.12.0

type TrialLicense struct {
	ExpiresAtVal string
	IssuedAtVal  string
}

func (TrialLicense) ExpiresAt added in v0.12.0

func (l TrialLicense) ExpiresAt() string

func (TrialLicense) IssuedAt added in v0.12.0

func (l TrialLicense) IssuedAt() string

func (TrialLicense) LicenseType added in v0.12.0

func (l TrialLicense) LicenseType() string

type User

type User struct {
	Username    string
	FullName    string
	Email       string
	Company     string
	CountryCode string
	Picture     string
	IsRoot      bool
	CreatedAt   string
	Roles       []Role
}

type UserChangeSet

type UserChangeSet struct {
	IsRoot      *bool
	FullName    *string
	Company     *string
	CountryCode *string
	Picture     *string
	Email       *string
}

type Users

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

func (*Users) Add added in v0.5.0

func (c *Users) Add(username string, changeset UserChangeSet) (User, error)

func (*Users) Get

func (c *Users) Get(username string) (User, error)

func (*Users) List

func (c *Users) List() ([]User, error)

func (*Users) Remove

func (c *Users) Remove(username string) (User, error)

func (*Users) Update

func (c *Users) Update(username string, changeset UserChangeSet) (User, error)

type View added in v0.5.0

type View struct {
	Name        string
	Roles       []RolePermission
	Connections []ViewConnection
}

type ViewConnection added in v0.15.0

type ViewConnection struct {
	RepoName string
	Filter   string
}

type ViewListItem added in v0.11.0

type ViewListItem struct {
	Name string
}

type ViewQueryData added in v0.15.0

type ViewQueryData struct {
	Name     string
	Roles    []RolePermission
	ViewInfo struct {
		Connections []struct {
			Repository struct{ Name string }
			Filter     string
		}
	} `graphql:"... on View"`
}

type Viewer added in v0.4.0

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

func (*Viewer) Username added in v0.4.0

func (c *Viewer) Username() (string, error)

Username fetches the username associated with the API Token in use.

type Views added in v0.5.0

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

func (*Views) Get added in v0.5.0

func (c *Views) Get(name string) (*View, error)

func (*Views) List added in v0.11.0

func (c *Views) List() ([]ViewListItem, error)

Jump to

Keyboard shortcuts

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