Documentation ¶
Index ¶
- Constants
- Variables
- func DownloadPluginFromGithub(ctx context.Context, localPath string, org string, name string, version string, ...) error
- func DownloadPluginFromHub(ctx context.Context, authToken, localPath, team, name, version string, ...) error
- func GenerateRandomUnixSocketName() string
- func WithBinarySuffix(filePath string) string
- type Client
- type Clients
- type Config
- type LogReader
- type Metrics
- type Option
- type PluginType
- type Registry
Constants ¶
const ( DefaultDownloadDir = ".cq" RetryAttempts = 5 RetryWaitTime = 1 * time.Second APIBaseURL = "https://api.cloudquery.io" )
Variables ¶
var (
ErrLogLineToLong = errors.New("log line too long, discarding")
)
Functions ¶
func DownloadPluginFromHub ¶ added in v1.11.0
func DownloadPluginFromHub(ctx context.Context, authToken, localPath, team, name, version string, typ PluginType) 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 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 WithDirectory ¶
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
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