{"modulePath":"github.com/cloudquery/plugin-pb-go","version":"v1.29.2","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package managedplugin\n\n## Constants\n\n```go\nconst (\n\tDefaultDownloadDir = \".cq\"\n\tRetryAttempts      = 5\n\tRetryWaitTime      = 1 * time.Second\n\tMaxRetryWaitTime   = 8 * time.Second\n)\n```\n\n```go\nconst (\n\tDefaultCloudQueryDockerHost = \"docker.cloudquery.io\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrLoginRequired = errors.New(\"login required\")\n\tErrTeamRequired  = errors.New(\"team required\")\n)\n```\n\n```go\nvar ErrArchMismatch = errors.New(\"plugin binary architecture mismatch\")\n```\nErrArchMismatch is returned when a cached plugin binary was built for a different architecture than the one we are running on.\n\n```go\nvar (\n\tErrLogLineToLong = errors.New(\"log line too long, discarding\")\n)\n```\n\n## Functions\n\n```go\nfunc APIBaseURL() string\n```\n\n```go\nfunc GenerateRandomUnixSocketName() string\n```\n\n```go\nfunc IsTransientDownloadError(err error) bool\n```\nIsTransientDownloadError reports whether err is a transient plugin download failure - a network or server-side problem rather than a bad plugin reference. Callers use it to keep advice about plugin resolution off errors that have nothing to do with it.\n\n```go\nfunc WithBinarySuffix(filePath string) string\n```\n\n## Types\n\n```go\ntype AssetSource int\n```\n\n```go\nconst (\n\tAssetSourceUnknown AssetSource = iota\n\tAssetSourceCached\n\tAssetSourceRemote\n)\n```\n\n```go\nfunc AssetSourceFromString(s string) (AssetSource, error)\n```\n\n```go\nfunc DownloadPluginFromGithub(ctx context.Context, logger zerolog.Logger, localPath string, org string, name string, version string, typ PluginType, dops DownloaderOptions) (AssetSource, error)\n```\n\n```go\nfunc DownloadPluginFromHub(ctx context.Context, logger zerolog.Logger, c *cloudquery_api.ClientWithResponses, ops HubDownloadOptions, dops DownloaderOptions) (AssetSource, error)\n```\n\n```go\nfunc (r AssetSource) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (r AssetSource) String() string\n```\n\n```go\nfunc (r *AssetSource) UnmarshalJSON(data []byte) (err error)\n```\n\n```go\ntype Client struct {\n\tLocalPath string\n\n\tConn *grpc.ClientConn\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewClient(ctx context.Context, typ PluginType, config Config, opts ...Option) (*Client, error)\n```\nNewClient 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.\n\n```go\nfunc (c *Client) ConnectionString() string\n```\n\n```go\nfunc (c *Client) MaxVersion(ctx context.Context) (int, error)\n```\n\n```go\nfunc (c *Client) Metrics() Metrics\n```\n\n```go\nfunc (c *Client) Name() string\n```\n\n```go\nfunc (c *Client) Terminate() error\n```\n\n```go\nfunc (c *Client) Versions(ctx context.Context) ([]int, error)\n```\n\n```go\ntype Clients []*Client\n```\n\n```go\nfunc NewClients(ctx context.Context, typ PluginType, specs []Config, opts ...Option) (Clients, error)\n```\ntyp will be deprecated soon but now required for a transition period\n\n```go\nfunc (c Clients) ClientByName(name string) *Client\n```\n\n```go\nfunc (c Clients) Terminate() error\n```\n\n```go\ntype Config struct {\n\tName        string\n\tRegistry    Registry\n\tPath        string\n\tVersion     string\n\tEnvironment []string // environment variables to pass to the plugin in key=value format\n\tDockerAuth  string\n}\n```\n\n```go\ntype DownloaderOptions struct {\n\tNoProgress bool\n}\n```\n\n```go\ntype HubDownloadOptions struct {\n\tAuthToken     string\n\tTeamName      string\n\tLocalPath     string\n\tPluginTeam    string\n\tPluginKind    string\n\tPluginName    string\n\tPluginVersion string\n}\n```\n\n```go\ntype LogReader struct {\n\t// contains filtered or unexported fields\n}\n```\nlogReader is a custom implementation similar to bufio.Scanner, but provides a way to handle lines (or tokens) that exceed the buffer size.\n\n```go\nfunc NewLogReader(reader io.ReadCloser) *LogReader\n```\nnewLogReader creates a new logReader to read log lines from an io.ReadCloser\n\n```go\nfunc (r *LogReader) NextLine() ([]byte, error)\n```\nNextLine 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.\n\n```go\ntype Metrics struct {\n\tErrors      uint64\n\tWarnings    uint64\n\tAssetSource AssetSource\n}\n```\n\n```go\ntype Option func(*Client)\n```\n\n```go\nfunc WithAuthToken(authToken string) Option\n```\n\n```go\nfunc WithCloudQueryDockerHost(dockerHost string) Option\n```\n\n```go\nfunc WithDirectory(directory string) Option\n```\n\n```go\nfunc WithDockerExtraHosts(extraHosts []string) Option\n```\n\n```go\nfunc WithLicenseFile(licenseFile string) Option\n```\n\n```go\nfunc WithLogger(logger zerolog.Logger) Option\n```\n\n```go\nfunc WithNoExec() Option\n```\n\n```go\nfunc WithNoProgress() Option\n```\n\n```go\nfunc WithNoSentry() Option\n```\n\n```go\nfunc WithOtelEndpoint(endpoint string) Option\n```\n\n```go\nfunc WithOtelEndpointInsecure() Option\n```\n\n```go\nfunc WithTeamName(teamName string) Option\n```\n\n```go\nfunc WithUseTCP() Option\n```\n\n```go\ntype PluginType int\n```\nPluginType 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.\n\n```go\nconst (\n\tPluginSource PluginType = iota\n\tPluginDestination\n\tPluginTransformer\n)\n```\n\n```go\nfunc (p PluginType) String() string\n```\n\n```go\ntype PluginVersionWarner struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewPluginVersionWarner(logger zerolog.Logger, optionalAuthToken string) (*PluginVersionWarner, error)\n```\n\n```go\nfunc (p *PluginVersionWarner) LatestVersion(ctx context.Context, org string, name string, kind string) (*semver.Version, error)\n```\n\n```go\ntype Registry int\n```\n\n```go\nconst (\n\tRegistryGithub Registry = iota\n\tRegistryLocal\n\tRegistryGrpc\n\tRegistryDocker\n\tRegistryCloudQuery\n)\n```\n\n```go\nfunc RegistryFromString(s string) (Registry, error)\n```\n\n```go\nfunc (r Registry) MarshalJSON() ([]byte, error)\n```\n\n```go\nfunc (r Registry) String() string\n```\n\n```go\nfunc (r *Registry) UnmarshalJSON(data []byte) (err error)\n```\n\n","path":"github.com/cloudquery/plugin-pb-go/managedplugin","name":"managedplugin","synopsis":"","isRedistributable":true}
