Documentation
¶
Overview ¶
Package infrahub provides an idiomatic Go client for the Infrahub API.
Infrahub schemas are dynamic and branch-specific. The Client therefore exposes both typed services for stable Infrahub operations and Execute for arbitrary GraphQL operations against user-defined schemas.
Index ¶
- Constants
- func WithTracker(ctx context.Context, tracker string) context.Context
- type AutomationCheck
- type AutomationCheckResult
- type AutomationFinding
- type AutomationGenerator
- type AutomationQueryOptions
- type AutomationReporter
- type AutomationRunOptions
- type AutomationService
- type AutomationSeverity
- type AutomationTransform
- type Branch
- type BranchCreateOptions
- type BranchService
- type BranchStatus
- type Client
- type DiffAction
- type DiffCounts
- type DiffElement
- type DiffElementType
- type DiffNode
- type DiffOptions
- type DiffPeer
- type DiffService
- type DiffTree
- type GraphQLError
- type GraphQLErrorItem
- type GraphQLErrorLocation
- type GraphQLRequest
- type HTTPError
- type Node
- type NodeMutationResult
- type NodePage
- type NodeService
- type NotFoundError
- type ObjectStoreService
- type ObjectStoreUnsupportedContentTypeError
- type ObjectStoreUploadResult
- type OperationError
- type Option
- type Repository
- type RepositoryBranchState
- type RepositoryListOptions
- type RepositoryService
- type RepositoryUpdateCommitOptions
- type ResourcePoolAddressOptions
- type ResourcePoolAllocatedOptions
- type ResourcePoolAllocation
- type ResourcePoolAllocationPage
- type ResourcePoolMemberType
- type ResourcePoolPrefixOptions
- type ResourcePoolService
- type ResourcePoolUtilization
- type ResourcePoolUtilizationResult
- type SchemaService
- type Task
- type TaskAmbiguousError
- type TaskFilter
- type TaskListOptions
- type TaskLog
- type TaskPage
- type TaskRelatedNode
- type TaskService
- type TaskState
- type TrackingGroup
- type TrackingGroupOptions
- type TrackingGroupResult
- type TraversalHop
- type TraversalNode
- type TraversalPath
- type TraversalPathsOptions
- type TraversalPathsResult
- type TraversalReachableNode
- type TraversalReachableOptions
- type TraversalReachableResult
- type TraversalRelationship
- type TraversalService
- type TraversalUnsupportedError
Constants ¶
const ( AutomationSeverityInfo = automation.SeverityInfo AutomationSeverityWarning = automation.SeverityWarning AutomationSeverityError = automation.SeverityError )
const ( DiffActionAdded = diffservice.ActionAdded DiffActionUpdated = diffservice.ActionUpdated DiffActionRemoved = diffservice.ActionRemoved DiffActionUnchanged = diffservice.ActionUnchanged DiffActionConflict = diffservice.ActionConflict )
const ( DiffElementTypeAttribute = diffservice.ElementTypeAttribute DiffElementTypeRelationshipOne = diffservice.ElementTypeRelationshipOne DiffElementTypeRelationshipMany = diffservice.ElementTypeRelationshipMany )
const ( ResourcePoolMemberTypePrefix = resourcepool.MemberTypePrefix ResourcePoolMemberTypeAddress = resourcepool.MemberTypeAddress )
const ( TaskStateScheduled = task.StateScheduled TaskStatePending = task.StatePending TaskStateRunning = task.StateRunning TaskStateCompleted = task.StateCompleted TaskStateFailed = task.StateFailed TaskStateCancelled = task.StateCancelled TaskStateCrashed = task.StateCrashed TaskStatePaused = task.StatePaused TaskStateCancelling = task.StateCancelling )
const ( BranchStatusOpen = branch.StatusOpen BranchStatusNeedRebase = branch.StatusNeedRebase BranchStatusNeedUpgradeRebase = branch.StatusNeedUpgradeRebase BranchStatusDeleting = branch.StatusDeleting BranchStatusMerging = branch.StatusMerging BranchStatusMerged = branch.StatusMerged )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AutomationCheck ¶
type AutomationCheck = automation.Check
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type AutomationCheckResult ¶
type AutomationCheckResult = automation.CheckResult
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type AutomationFinding ¶
type AutomationFinding = automation.Finding
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type AutomationGenerator ¶
type AutomationGenerator = automation.Generator
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type AutomationQueryOptions ¶
type AutomationQueryOptions = automation.QueryOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type AutomationReporter ¶
type AutomationReporter = automation.Reporter
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type AutomationRunOptions ¶
type AutomationRunOptions = automation.RunOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type AutomationService ¶
type AutomationService = automation.Service
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type AutomationSeverity ¶
type AutomationSeverity = automation.Severity
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type AutomationTransform ¶
type AutomationTransform = automation.Transform
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type Branch ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type BranchCreateOptions ¶
type BranchCreateOptions = branch.CreateOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type BranchService ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type BranchStatus ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type Client ¶
type Client struct {
Branches *branch.Service
Automation *automation.Service
Diffs *diffservice.Service
Schema *schema.Service
Nodes *node.Service
Repositories *repository.Service
ResourcePools *resourcepool.Service
ObjectStore *objectstore.Service
Tasks *task.Service
Telemetry *telemetry.Service
Traversal *traversal.Service
// contains filtered or unexported fields
}
Client is the high-level Infrahub client. It is safe for concurrent use. Its services share immutable configuration and one HTTP connection pool.
func (*Client) DefaultBranch ¶
DefaultBranch returns the client's default branch.
type DiffAction ¶
type DiffAction = diffservice.Action
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type DiffCounts ¶
type DiffCounts = diffservice.Counts
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type DiffElement ¶
type DiffElement = diffservice.Element
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type DiffElementType ¶
type DiffElementType = diffservice.ElementType
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type DiffNode ¶
type DiffNode = diffservice.Node
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type DiffOptions ¶
type DiffOptions = diffservice.Options
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type DiffPeer ¶
type DiffPeer = diffservice.Peer
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type DiffService ¶
type DiffService = diffservice.Service
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type DiffTree ¶
type DiffTree = diffservice.Tree
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type GraphQLError ¶
type GraphQLError = api.GraphQLError
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type GraphQLErrorItem ¶
type GraphQLErrorItem = api.GraphQLErrorItem
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type GraphQLErrorLocation ¶
type GraphQLErrorLocation = api.GraphQLErrorLocation
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type GraphQLRequest ¶
type GraphQLRequest = api.GraphQLRequest
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type HTTPError ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type Node ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type NodeMutationResult ¶
type NodeMutationResult = node.MutationResult
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type NodePage ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type NodeService ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type NotFoundError ¶
type NotFoundError = api.NotFoundError
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ObjectStoreService ¶
type ObjectStoreService = objectstore.Service
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ObjectStoreUnsupportedContentTypeError ¶
type ObjectStoreUnsupportedContentTypeError = objectstore.UnsupportedContentTypeError
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ObjectStoreUploadResult ¶
type ObjectStoreUploadResult = objectstore.UploadResult
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type OperationError ¶
type OperationError = api.OperationError
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type Option ¶
type Option func(*config) error
Option configures a Client.
func WithAPIToken ¶
WithAPIToken configures authentication through X-INFRAHUB-KEY.
func WithDefaultBranch ¶
WithDefaultBranch sets the branch used when an operation does not specify one.
func WithHTTPClient ¶
WithHTTPClient makes the client use hc. The SDK does not mutate hc.
func WithHeader ¶
WithHeader adds a header to every request. Authentication headers cannot be set through this option; use WithAPIToken instead.
func WithMaxResponseBytes ¶
WithMaxResponseBytes limits response bodies read by the SDK.
func WithUserAgent ¶
WithUserAgent changes the User-Agent sent by the SDK.
type Repository ¶
type Repository = repository.Repository
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type RepositoryBranchState ¶
type RepositoryBranchState = repository.BranchState
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type RepositoryListOptions ¶
type RepositoryListOptions = repository.ListOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type RepositoryService ¶
type RepositoryService = repository.Service
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type RepositoryUpdateCommitOptions ¶
type RepositoryUpdateCommitOptions = repository.UpdateCommitOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ResourcePoolAddressOptions ¶
type ResourcePoolAddressOptions = resourcepool.AddressOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ResourcePoolAllocatedOptions ¶
type ResourcePoolAllocatedOptions = resourcepool.AllocatedOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ResourcePoolAllocation ¶
type ResourcePoolAllocation = resourcepool.Allocation
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ResourcePoolAllocationPage ¶
type ResourcePoolAllocationPage = resourcepool.AllocationPage
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ResourcePoolMemberType ¶
type ResourcePoolMemberType = resourcepool.MemberType
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ResourcePoolPrefixOptions ¶
type ResourcePoolPrefixOptions = resourcepool.PrefixOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ResourcePoolService ¶
type ResourcePoolService = resourcepool.Service
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ResourcePoolUtilization ¶
type ResourcePoolUtilization = resourcepool.Utilization
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type ResourcePoolUtilizationResult ¶
type ResourcePoolUtilizationResult = resourcepool.UtilizationResult
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type SchemaService ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type Task ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TaskAmbiguousError ¶
type TaskAmbiguousError = task.AmbiguousError
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TaskFilter ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TaskListOptions ¶
type TaskListOptions = task.ListOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TaskLog ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TaskPage ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TaskRelatedNode ¶
type TaskRelatedNode = task.RelatedNode
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TaskService ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TaskState ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TrackingGroup ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
func NewTrackingGroup ¶
func NewTrackingGroup(options TrackingGroupOptions) (*TrackingGroup, error)
NewTrackingGroup creates a request-scoped group collector.
type TrackingGroupOptions ¶
type TrackingGroupOptions = tracking.GroupOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TrackingGroupResult ¶
type TrackingGroupResult = tracking.GroupResult
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalHop ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalNode ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalPath ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalPathsOptions ¶
type TraversalPathsOptions = traversal.PathsOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalPathsResult ¶
type TraversalPathsResult = traversal.PathsResult
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalReachableNode ¶
type TraversalReachableNode = traversal.ReachableNode
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalReachableOptions ¶
type TraversalReachableOptions = traversal.ReachableOptions
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalReachableResult ¶
type TraversalReachableResult = traversal.ReachableResult
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalRelationship ¶
type TraversalRelationship = traversal.Relationship
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalService ¶
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
type TraversalUnsupportedError ¶
type TraversalUnsupportedError = traversal.UnsupportedError
Root-package aliases keep common SDK types discoverable and preserve the API that predates the domain package split.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
infrahubctl
command
Command infrahubctl provides a command-line client for Infrahub.
|
Command infrahubctl provides a command-line client for Infrahub. |
|
internal
|
|
|
cli
Package cli implements the infrahubctl command without coupling command parsing to the executable entry point.
|
Package cli implements the infrahubctl command without coupling command parsing to the executable entry point. |
|
requestcontext
Package requestcontext carries immutable request metadata between SDK layers.
|
Package requestcontext carries immutable request metadata between SDK layers. |
|
pkg
|
|
|
api
Package api implements Infrahub's low-level HTTP and GraphQL protocol.
|
Package api implements Infrahub's low-level HTTP and GraphQL protocol. |
|
automation
Package automation provides Go-native transforms, generators, and checks.
|
Package automation provides Go-native transforms, generators, and checks. |
|
batch
Package batch provides bounded, cancellation-aware concurrent execution.
|
Package batch provides bounded, cancellation-aware concurrent execution. |
|
branch
Package branch provides operations for Infrahub branches.
|
Package branch provides operations for Infrahub branches. |
|
config
Package config loads Infrahub client configuration from TOML and the environment.
|
Package config loads Infrahub client configuration from TOML and the environment. |
|
diff
Package diff provides branch diff summaries and complete diff trees.
|
Package diff provides branch diff summaries and complete diff trees. |
|
node
Package node provides generic operations for schema-defined Infrahub nodes.
|
Package node provides generic operations for schema-defined Infrahub nodes. |
|
objectstore
Package objectstore provides access to Infrahub object and file storage.
|
Package objectstore provides access to Infrahub object and file storage. |
|
repository
Package repository provides operations for Git repositories managed by Infrahub.
|
Package repository provides operations for Git repositories managed by Infrahub. |
|
resourcepool
Package resourcepool provides IP address and prefix allocation operations.
|
Package resourcepool provides IP address and prefix allocation operations. |
|
schema
Package schema provides operations for Infrahub's branch-aware schemas.
|
Package schema provides operations for Infrahub's branch-aware schemas. |
|
task
Package task provides operations for Infrahub background tasks.
|
Package task provides operations for Infrahub background tasks. |
|
telemetry
Package telemetry provides access to Infrahub telemetry snapshots.
|
Package telemetry provides access to Infrahub telemetry snapshots. |
|
tracking
Package tracking provides request-scoped trackers and Infrahub group collection.
|
Package tracking provides request-scoped trackers and Infrahub group collection. |
|
traversal
Package traversal provides path and reachable-node graph traversal operations.
|
Package traversal provides path and reachable-node graph traversal operations. |