api

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const JSONContentType string = "application/json"

JSONContentType is "application/json"

View Source
const NotifierTypeEmail = "EmailNotifier"
View Source
const NotifierTypeHumioRepo = "HumioRepoNotifier"
View Source
const NotifierTypeOpsGenie = "OpsGenieNotifier"
View Source
const NotifierTypePagerDuty = "PagerDutyNotifier"
View Source
const NotifierTypeSlack = "SlackNotifier"
View Source
const NotifierTypeSlackPostMessage = "SlackPostMessageNotifier"
View Source
const NotifierTypeVictorOps = "VictorOpsNotifier"
View Source
const NotifierTypeWebHook = "WebHookNotifier"
View Source
const ZIPContentType string = "application/zip"

Variables

View Source
var ErrManagedGroupDoesNotExist = errors.New("managed export group does not exist")
View Source
var ErrUserNotFound = errors.New("user not found")

Functions

func CloneHeader added in v0.26.0

func CloneHeader(in http.Header) http.Header

CloneHeader creates a deep copy of an http.Header.

func CloneRequest added in v0.26.0

func CloneRequest(req *http.Request) *http.Request

CloneRequest creates a shallow copy of the request along with a deep copy of the Headers.

Types

type AddTransferJobResponse added in v0.28.1

type AddTransferJobResponse struct {
	ID string
}

type Alert added in v0.25.0

type Alert struct {
	ID                 string     `yaml:"-"                     json:"id"`
	Name               string     `yaml:"name"                  json:"name"`
	Query              HumioQuery `yaml:"query"                 json:"query"`
	Description        string     `yaml:"description,omitempty" json:"description"`
	ThrottleTimeMillis int        `yaml:"throttleTimeMillis"    json:"throttleTimeMillis"`
	Silenced           bool       `yaml:"silenced"              json:"silenced"`
	Notifiers          []string   `yaml:"notifiers"             json:"notifiers"`
	Labels             []string   `yaml:"labels,omitempty"      json:"labels,omitempty"`
}

type Alerts added in v0.25.0

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

func (*Alerts) Add added in v0.25.0

func (a *Alerts) Add(viewName string, alert *Alert, updateExisting bool) (*Alert, error)

func (*Alerts) Delete added in v0.25.0

func (a *Alerts) Delete(viewName, alertName string) error

func (*Alerts) Get added in v0.25.0

func (a *Alerts) Get(viewName, alertName string) (*Alert, error)

func (*Alerts) List added in v0.25.0

func (a *Alerts) List(viewName string) ([]Alert, error)

func (*Alerts) Update added in v0.25.0

func (a *Alerts) Update(viewName string, alert *Alert) (*Alert, error)

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

func (*Client) Address

func (c *Client) Address() *url.URL

func (*Client) Alerts added in v0.25.0

func (c *Client) Alerts() *Alerts

func (*Client) CACertificate added in v0.26.0

func (c *Client) CACertificate() string

func (*Client) ClusterNodes added in v0.25.0

func (c *Client) ClusterNodes() *ClusterNodes

func (*Client) Clusters added in v0.25.0

func (c *Client) Clusters() *Clusters

func (*Client) Config added in v0.28.1

func (c *Client) Config() Config

func (*Client) Groups added in v0.28.1

func (c *Client) Groups() *Groups

func (*Client) HTTPRequest added in v0.25.0

func (c *Client) HTTPRequest(httpMethod string, path string, body io.Reader) (*http.Response, error)

func (*Client) HTTPRequestContext added in v0.25.0

func (c *Client) HTTPRequestContext(ctx context.Context, httpMethod string, path string, body io.Reader, contentType string) (*http.Response, error)

func (*Client) Health added in v0.25.0

func (c *Client) Health() (Health, error)

func (*Client) HealthString added in v0.25.0

func (c *Client) HealthString() (string, error)

func (*Client) IngestTokens

func (c *Client) IngestTokens() *IngestTokens

func (*Client) Insecure added in v0.26.0

func (c *Client) Insecure() bool

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) Notifiers added in v0.25.0

func (c *Client) Notifiers() *Notifiers

func (*Client) Organizations added in v0.28.1

func (c *Client) Organizations() *Organizations

func (*Client) Packages added in v0.27.0

func (c *Client) Packages() *Packages

Packages constructs a Packages API client.

func (*Client) Parsers

func (c *Client) Parsers() *Parsers

func (*Client) Query

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

func (*Client) QueryJobs added in v0.25.0

func (c *Client) QueryJobs() *QueryJobs

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) Transfer added in v0.28.1

func (c *Client) Transfer() *Transfer

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 Cluster added in v0.25.0

type Cluster struct {
	Nodes                               []ClusterNode
	ClusterInfoAgeSeconds               float64
	UnderReplicatedSegmentSize          float64
	OverReplicatedSegmentSize           float64
	MissingSegmentSize                  float64
	ProperlyReplicatedSegmentSize       float64
	TargetUnderReplicatedSegmentSize    float64
	TargetOverReplicatedSegmentSize     float64
	TargetMissingSegmentSize            float64
	TargetProperlyReplicatedSegmentSize float64
	IngestPartitions                    []IngestPartition
	StoragePartitions                   []StoragePartition
}

type ClusterNode added in v0.25.0

type ClusterNode struct {
	Id                      int
	Name                    string
	Uri                     string
	Uuid                    string
	ClusterInfoAgeSeconds   float64
	InboundSegmentSize      float64
	OutboundSegmentSize     float64
	StorageDivergence       float64
	CanBeSafelyUnregistered bool
	CurrentSize             float64
	PrimarySize             float64
	SecondarySize           float64
	TotalSizeOfPrimary      float64
	TotalSizeOfSecondary    float64
	FreeOnPrimary           float64
	FreeOnSecondary         float64
	WipSize                 float64
	TargetSize              float64
	Reapply_targetSize      float64
	SolitarySegmentSize     float64
	IsAvailable             bool
	LastHeartbeat           string
	// Zone holds the availability zone as configured in the `ZONE` configuration of the Humio server.
	Zone string
}

type ClusterNodes added in v0.25.0

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

func (*ClusterNodes) Get added in v0.25.0

func (n *ClusterNodes) Get(nodeID int) (ClusterNode, error)

func (*ClusterNodes) List added in v0.25.0

func (n *ClusterNodes) List() ([]ClusterNode, error)

func (*ClusterNodes) Unregister added in v0.25.0

func (n *ClusterNodes) Unregister(nodeID int64, force bool) error

type Clusters added in v0.25.0

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

func (*Clusters) ClusterMoveIngestRoutesAwayFromNode added in v0.25.0

func (c *Clusters) ClusterMoveIngestRoutesAwayFromNode(nodeID int) error

func (*Clusters) ClusterMoveStorageRouteAwayFromNode added in v0.25.0

func (c *Clusters) ClusterMoveStorageRouteAwayFromNode(nodeID int) error

func (*Clusters) Get added in v0.25.0

func (c *Clusters) Get() (Cluster, error)

func (*Clusters) StartDataRedistribution added in v0.25.0

func (c *Clusters) StartDataRedistribution() error

func (*Clusters) SuggestedIngestPartitions added in v0.28.1

func (c *Clusters) SuggestedIngestPartitions() ([]IngestPartitionInput, error)

func (*Clusters) SuggestedStoragePartitions added in v0.28.1

func (c *Clusters) SuggestedStoragePartitions() ([]StoragePartitionInput, error)

func (*Clusters) UpdateIngestPartitionScheme added in v0.25.0

func (c *Clusters) UpdateIngestPartitionScheme(desired []IngestPartitionInput) error

func (*Clusters) UpdateStoragePartitionScheme added in v0.25.0

func (c *Clusters) UpdateStoragePartitionScheme(desired []StoragePartitionInput) error

type Config

type Config struct {
	Address           *url.URL
	Token             string
	CACertificatePEM  string
	Insecure          bool
	ProxyOrganization string
	DialContext       func(ctx context.Context, network, addr string) (net.Conn, error)
}

func DefaultConfig

func DefaultConfig() Config

type DefaultGroupEnum added in v0.27.0

type DefaultGroupEnum string
const (
	DefaultGroupEnumMember     DefaultGroupEnum = "Member"
	DefaultGroupEnumAdmin      DefaultGroupEnum = "Admin"
	DefaultGroupEnumEliminator DefaultGroupEnum = "Eliminator"
)

func (*DefaultGroupEnum) ParseString added in v0.27.0

func (e *DefaultGroupEnum) ParseString(s string) bool

func (DefaultGroupEnum) String added in v0.27.0

func (e DefaultGroupEnum) String() string

type Group added in v0.28.1

type Group struct {
	ID          string
	DisplayName string
}

type Groups added in v0.28.1

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

func (*Groups) AddUserToGroup added in v0.28.1

func (g *Groups) AddUserToGroup(groupID string, userID string) error

func (*Groups) List added in v0.28.1

func (g *Groups) List() ([]Group, error)

func (*Groups) RemoveUserFromGroup added in v0.28.1

func (g *Groups) RemoveUserFromGroup(groupID string, userID string) error

type Health added in v0.25.0

type Health struct {
	Status        StatusValue   `json:"status"`
	StatusMessage string        `json:"statusMessage"`
	Uptime        string        `json:"uptime"`
	Version       string        `json:"version"`
	OK            []HealthCheck `json:"oks"`
	Warn          []HealthCheck `json:"warnings"`
	Down          []HealthCheck `json:"down"`
	// contains filtered or unexported fields
}

func (*Health) ChecksMap added in v0.25.0

func (h *Health) ChecksMap() map[string]HealthCheck

func (*Health) Json added in v0.25.0

func (h *Health) Json() []byte

type HealthCheck added in v0.25.0

type HealthCheck struct {
	Name          string                 `json:"name"`
	Status        StatusValue            `json:"status"`
	StatusMessage string                 `json:"statusMessage"`
	Fields        map[string]interface{} `json:"fields"`
}

type HumioQuery added in v0.25.0

type HumioQuery struct {
	QueryString string `yaml:"queryString" json:"queryString"`
	Start       string `yaml:"start"       json:"start"`
	End         string `yaml:"end"         json:"end"`
	IsLive      bool   `yaml:"isLive"      json:"isLive"`
}

type IngestPartition added in v0.25.0

type IngestPartition struct {
	Id      int
	NodeIds []int
}

type IngestPartitionInput added in v0.25.0

type IngestPartitionInput struct {
	ID      graphql.Int   `json:"id"`
	NodeIDs []graphql.Int `json:"nodeIds"`
}

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 (i *IngestTokens) Add(repositoryName string, tokenName string, parserName string) (*IngestToken, error)

func (*IngestTokens) Get added in v0.25.0

func (i *IngestTokens) Get(repoName, tokenName string) (*IngestToken, error)

func (*IngestTokens) List

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

func (*IngestTokens) Remove

func (i *IngestTokens) Remove(repositoryName string, tokenName string) error

func (*IngestTokens) Update added in v0.25.0

func (i *IngestTokens) Update(repositoryName string, tokenName string, parserName string) (*IngestToken, error)

type InstalledPackage added in v0.28.0

type InstalledPackage struct {
	ID          string
	InstalledBy *struct {
		Username  string
		Timestamp string
	}
	UpdatedBy *struct {
		Username  string
		Timestamp string
	}
	Source          string
	AvailableUpdate string
}

InstalledPackage contain the details of an installed package

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 (l *Licenses) Get() (License, error)

func (*Licenses) Install added in v0.12.0

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

type Notifier added in v0.25.0

type Notifier struct {
	Entity     string                 `json:"entity"`
	ID         string                 `json:"id,omitempty"`
	Name       string                 `json:"name"`
	Properties map[string]interface{} `json:"properties"`
}

type Notifiers added in v0.25.0

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

func (*Notifiers) Add added in v0.25.0

func (n *Notifiers) Add(viewName string, notifier *Notifier, force bool) (*Notifier, error)

func (*Notifiers) Delete added in v0.25.0

func (n *Notifiers) Delete(viewName, notifierName string) error

func (*Notifiers) Get added in v0.25.0

func (n *Notifiers) Get(viewName, notifierName string) (*Notifier, error)

func (*Notifiers) GetByID added in v0.25.0

func (n *Notifiers) GetByID(viewName, notifierID string) (*Notifier, error)

func (*Notifiers) List added in v0.25.0

func (n *Notifiers) List(viewName string) ([]Notifier, error)

func (*Notifiers) Update added in v0.25.0

func (n *Notifiers) Update(viewName string, notifier *Notifier) (*Notifier, 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 Organization added in v0.28.1

type Organization struct {
	ID          string
	Name        string
	Description *string
}

type Organizations added in v0.28.1

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

func (*Organizations) CreateOrganization added in v0.28.1

func (o *Organizations) CreateOrganization(name string) (Organization, error)

type Packages added in v0.27.0

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

Packages is a API client for working with Humio packages.

func (*Packages) CreateArchive added in v0.27.0

func (p *Packages) CreateArchive(packageDirPath string, targetFileName string) error

CreateArchive creates a archive by bundling the files in packageDirPath in a zip file.

func (*Packages) InstallArchive added in v0.27.0

func (p *Packages) InstallArchive(viewName string, pathToZip string) (*ValidationResponse, error)

InstallArchive installs a local package (zip file).

func (*Packages) InstallFromDirectory added in v0.27.0

func (p *Packages) InstallFromDirectory(packageDirPath string, targetRepoOrView string) (*ValidationResponse, error)

InstallFromDirectory installs a package from a directory containing the package files.

func (*Packages) ListInstalled added in v0.28.0

func (p *Packages) ListInstalled(viewName string) ([]InstalledPackage, error)

ListInstalled returns a list of installed packages

func (*Packages) UninstallPackage added in v0.27.0

func (p *Packages) UninstallPackage(viewName string, packageID string) error

UninstallPackage uninstalls a package by name.

func (*Packages) Validate added in v0.27.0

func (p *Packages) Validate(viewName string, absPath string) (*ValidationResponse, error)

Validate checks a package declaration validity against a Humio server.

type Parser

type Parser struct {
	Name      string
	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) Export added in v0.27.0

func (p *Parsers) Export(reposistoryName string, parserName string) (string, 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 Query added in v0.25.0

type Query struct {
	QueryString                string            `json:"queryString"`
	Start                      string            `json:"start,omitempty"`
	End                        string            `json:"end,omitempty"`
	Live                       bool              `json:"isLive,omitempty"`
	TimezoneOffset             *int              `json:"timeZoneOffsetMinutes,omitempty"`
	Arguments                  map[string]string `json:"arguments,omitempty"`
	ShowQueryEventDistribution bool              `json:"showQueryEventDistribution,omitempty"`
}

type QueryError added in v0.25.0

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

func (QueryError) Error added in v0.25.0

func (e QueryError) Error() string

type QueryJobs added in v0.25.0

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

func (QueryJobs) Create added in v0.25.0

func (q QueryJobs) Create(repository string, query Query) (string, error)

func (*QueryJobs) Delete added in v0.25.0

func (q *QueryJobs) Delete(repository string, id string) error

func (*QueryJobs) Poll added in v0.25.0

func (q *QueryJobs) Poll(repository string, id string) (QueryResult, error)

func (*QueryJobs) PollContext added in v0.25.0

func (q *QueryJobs) PollContext(ctx context.Context, repository string, id string) (QueryResult, error)

type QueryResult added in v0.25.0

type QueryResult struct {
	Cancelled bool                     `json:"cancelled"`
	Done      bool                     `json:"done"`
	Events    []map[string]interface{} `json:"events"`
	Metadata  QueryResultMetadata      `json:"metaData"`
}

type QueryResultMetadata added in v0.25.0

type QueryResultMetadata struct {
	EventCount       uint64                 `json:"eventCount"`
	ExtraData        map[string]interface{} `json:"extraData"`
	FieldOrder       []string               `json:"fieldOrder"`
	IsAggregate      bool                   `json:"isAggregate"`
	PollAfter        int                    `json:"pollAfter"`
	ProcessedBytes   uint64                 `json:"processedBytes"`
	ProcessedEvents  uint64                 `json:"processedEvents"`
	QueryStart       uint64                 `json:"queryStart"`
	QueryEnd         uint64                 `json:"queryEnd"`
	ResultBufferSize uint64                 `json:"resultBufferSize"`
	TimeMillis       uint64                 `json:"timeMillis"`
	TotalWork        uint64                 `json:"totalWork"`
	WorkDone         uint64                 `json:"workDone"`
}

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 (r *Repositories) Create(name string) error

func (*Repositories) Delete added in v0.26.0

func (r *Repositories) Delete(name, reason string, allowDataDeletion bool) error

func (*Repositories) Get added in v0.13.0

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

func (*Repositories) List added in v0.13.0

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

func (*Repositories) UpdateDescription added in v0.26.0

func (r *Repositories) UpdateDescription(name, description string) error

func (*Repositories) UpdateIngestBasedRetention added in v0.26.0

func (r *Repositories) UpdateIngestBasedRetention(name string, ingestInGB float64, allowDataDeletion bool) error

func (*Repositories) UpdateStorageBasedRetention added in v0.26.0

func (r *Repositories) UpdateStorageBasedRetention(name string, storageInGB float64, allowDataDeletion bool) error

func (*Repositories) UpdateTimeBasedRetention added in v0.26.0

func (r *Repositories) UpdateTimeBasedRetention(name string, retentionInDays float64, allowDataDeletion bool) error

func (*Repositories) UpdateUserGroup added in v0.27.0

func (r *Repositories) UpdateUserGroup(name, username string, groups ...DefaultGroupEnum) error

type Repository added in v0.13.0

type Repository struct {
	ID                     string
	Name                   string
	Description            string
	RetentionDays          float64 `graphql:"timeBasedRetention"`
	IngestRetentionSizeGB  float64 `graphql:"ingestSizeBasedRetention"`
	StorageRetentionSizeGB float64 `graphql:"storageSizeBasedRetention"`
	SpaceUsed              int64   `graphql:"compressedByteSize"`
}

type StatusResponse added in v0.4.0

type StatusResponse struct {
	Status  string
	Version string
}

func (StatusResponse) IsDown added in v0.25.0

func (s StatusResponse) IsDown() bool

type StatusValue added in v0.25.0

type StatusValue string
const (
	StatusOK   StatusValue = "OK"
	StatusWarn StatusValue = "WARN"
	StatusDown StatusValue = "DOWN"
)

type StoragePartition added in v0.25.0

type StoragePartition struct {
	Id      int
	NodeIds []int
}

type StoragePartitionInput added in v0.25.0

type StoragePartitionInput struct {
	ID      graphql.Int   `json:"id"`
	NodeIDs []graphql.Int `json:"nodeIds"`
}

type Transfer added in v0.28.1

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

func (*Transfer) AddTransferJob added in v0.28.1

func (t *Transfer) AddTransferJob(sourceClusterURL string, sourceClusterToken string, destinationOrganizationID string, dataspaces []string, maximumParallelDownloads int, setTargetAsNewMaster bool) (AddTransferJobResponse, error)

func (*Transfer) CancelTransferJob added in v0.28.1

func (t *Transfer) CancelTransferJob(transferJobID string) (TransferJob, error)

func (*Transfer) CreateManagedExportGroup added in v0.28.1

func (t *Transfer) CreateManagedExportGroup() (string, error)

func (*Transfer) GetManagedExportGroup added in v0.28.1

func (t *Transfer) GetManagedExportGroup() (string, error)

func (*Transfer) GetTransferJobStatus added in v0.28.1

func (t *Transfer) GetTransferJobStatus(transferJobID string) (TransferJobStatus, error)

func (*Transfer) ListTransferJobs added in v0.28.1

func (t *Transfer) ListTransferJobs() ([]TransferJob, error)

func (*Transfer) RemoveManagedExportGroup added in v0.28.1

func (t *Transfer) RemoveManagedExportGroup() error

type TransferJob added in v0.28.1

type TransferJob struct {
	ID                       string
	SourceClusterURL         string
	Dataspaces               []string
	MaximumParallelDownloads int
	CompletedAt              *time.Time
	CancelledAt              *time.Time
}

type TransferJobStatus added in v0.28.1

type TransferJobStatus struct {
	TotalSegments       int
	TransferredSegments int
	Running             bool
	Error               string
	Status              string
	StatusLine          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 UnversionedPackageSpecifier added in v0.28.0

type UnversionedPackageSpecifier string

UnversionedPackageSpecifier is the ID of a package, e.g foo/bar

type User

type User struct {
	ID          string
	Username    string
	FullName    string
	Email       string
	Company     string
	CountryCode string
	Picture     string
	IsRoot      bool
	CreatedAt   string
}

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 (u *Users) Add(username string, changeset UserChangeSet) (User, error)

func (*Users) Get

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

func (*Users) List

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

func (*Users) Remove

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

func (*Users) RotateUserApiTokenAndGet added in v0.28.1

func (u *Users) RotateUserApiTokenAndGet(userID string) (string, error)

func (*Users) Update

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

type ValidationResponse added in v0.27.0

type ValidationResponse struct {
	InstallationErrors []string `json:"installationErrors"`
	ParseErrors        []string `json:"parseErrors"`
}

ValidationResponse contain the results of a package validation.

func (*ValidationResponse) IsValid added in v0.27.0

func (resp *ValidationResponse) IsValid() bool

IsValid returns true if there are no errors in the package

type VersionedPackageSpecifier added in v0.27.0

type VersionedPackageSpecifier string

VersionedPackageSpecifier is the ID and version of a package, e.g foo/bar@2.0.1

type View added in v0.5.0

type View struct {
	Name        string
	Connections []ViewConnection
}

type ViewConnection added in v0.15.0

type ViewConnection struct {
	RepoName string
	Filter   string
}

type ViewConnectionInput added in v0.28.1

type ViewConnectionInput struct {
	RepositoryName graphql.String `json:"repositoryName"`
	Filter         graphql.String `json:"filter"`
}

type ViewListItem added in v0.11.0

type ViewListItem struct {
	Name string
}

type ViewQueryData added in v0.15.0

type ViewQueryData struct {
	Name     string
	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) ApiToken added in v0.25.0

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

ApiToken fetches the api token for the user who is currently authenticated.

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) Create added in v0.28.1

func (c *Views) Create(name, description string, connections map[string]string) error

func (*Views) Delete added in v0.28.1

func (c *Views) Delete(name, reason string) error

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)

func (*Views) UpdateConnections added in v0.28.1

func (c *Views) UpdateConnections(name string, connections map[string]string) error

func (*Views) UpdateDescription added in v0.28.1

func (c *Views) UpdateDescription(name string, description string) error

Jump to

Keyboard shortcuts

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