Documentation ¶
Index ¶
- Constants
- Variables
- func APIBaseURL() string
- func DownloadPluginFromGithub(ctx context.Context, logger zerolog.Logger, localPath string, org string, ...) error
- func DownloadPluginFromHub(ctx context.Context, c *cloudquery_api.ClientWithResponses, ...) error
- func GenerateRandomUnixSocketName() string
- func WithBinarySuffix(filePath string) string
- type Client
- type Clients
- type Config
- type HubDownloadOptions
- type LogReader
- type Metrics
- type Option
- func WithAuthToken(authToken string) Option
- func WithCloudQueryDockerHost(dockerHost string) Option
- func WithDirectory(directory string) Option
- func WithLicenseFile(licenseFile string) Option
- func WithLogger(logger zerolog.Logger) Option
- func WithNoExec() Option
- func WithNoSentry() Option
- func WithOtelEndpoint(endpoint string) Option
- func WithOtelEndpointInsecure() Option
- func WithTeamName(teamName string) Option
- type PluginType
- type Registry
Constants ¶
const ( DefaultDownloadDir = ".cq" RetryAttempts = 5 RetryWaitTime = 1 * time.Second )
const (
DefaultCloudQueryDockerHost = "docker.cloudquery.io"
)
Variables ¶
var ( ErrLoginRequired = fmt.Errorf("login required") ErrTeamRequired = fmt.Errorf("team required") )
var (
ErrLogLineToLong = errors.New("log line too long, discarding")
)
Functions ¶
func APIBaseURL ¶ added in v1.11.0
func APIBaseURL() string
func DownloadPluginFromHub ¶ added in v1.11.0
func DownloadPluginFromHub(ctx context.Context, c *cloudquery_api.ClientWithResponses, ops HubDownloadOptions) error
func GenerateRandomUnixSocketName ¶
func GenerateRandomUnixSocketName() string
func WithBinarySuffix ¶
Types ¶
type Client ¶
type Client struct { LocalPath string Conn *grpc.ClientConn // contains filtered or unexported fields }
func NewClient ¶
NewClient creates a new plugin client. If registrySpec is GitHub then client downloads the plugin, spawns it and creates a gRPC connection. If registrySpec is Local then client spawns the plugin and creates a gRPC connection. If registrySpec is gRPC then clients creates a new connection If registrySpec is Docker then client downloads the docker image, runs it and creates a gRPC connection.
func (*Client) ConnectionString ¶ added in v1.6.0
type Clients ¶
type Clients []*Client
func NewClients ¶
func NewClients(ctx context.Context, typ PluginType, specs []Config, opts ...Option) (Clients, error)
typ will be deprecated soon but now required for a transition period
func (Clients) ClientByName ¶
type HubDownloadOptions ¶ added in v1.14.0
type LogReader ¶
type LogReader struct {
// contains filtered or unexported fields
}
logReader is a custom implementation similar to bufio.Scanner, but provides a way to handle lines (or tokens) that exceed the buffer size.
func NewLogReader ¶
func NewLogReader(reader io.ReadCloser) *LogReader
newLogReader creates a new logReader to read log lines from an io.ReadCloser
func (*LogReader) NextLine ¶
NextLine reads and returns the next log line from the reader. An io.EOF error is returned if the end of the stream has been reached. This implementation is different from bufio.Scanner as it also returns an error if a line is too long to fit into the buffer. In this case, an error is returned together with a limited prefix of the line.
type Option ¶
type Option func(*Client)
func WithAuthToken ¶ added in v1.13.0
func WithCloudQueryDockerHost ¶ added in v1.17.0
func WithDirectory ¶
func WithLicenseFile ¶ added in v1.15.0
func WithLogger ¶
func WithNoExec ¶ added in v1.10.0
func WithNoExec() Option
func WithNoSentry ¶
func WithNoSentry() Option
func WithOtelEndpoint ¶ added in v1.8.0
func WithOtelEndpointInsecure ¶ added in v1.8.0
func WithOtelEndpointInsecure() Option
func WithTeamName ¶ added in v1.14.0
type PluginType ¶
type PluginType int
PluginType specifies if a plugin is a source or a destination. It actually doesn't really have any effect as plugins can serve both as source and as destinations, but it is here for backward compatibility.
const ( PluginSource PluginType = iota PluginDestination )
func (PluginType) String ¶
func (p PluginType) String() string
type Registry ¶
type Registry int