api

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 13 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) 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) 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 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 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 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
}

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)

Jump to

Keyboard shortcuts

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