Documentation
¶
Index ¶
- Constants
- type BulkError
- type BulkResult
- type CatalogInfo
- type CatalogSpec
- type Client
- func (c *Client) BulkDelete(ctx context.Context, catalogID string, externalIDs []string) (*BulkResult, error)
- func (c *Client) BulkUpsert(ctx context.Context, catalogID string, ents []catalog.DesiredEntity) (*BulkResult, error)
- func (c *Client) EnsureCatalog(ctx context.Context, spec CatalogSpec) (string, error)
- func (c *Client) EnsureFields(ctx context.Context, catalogID string, fields []FieldSpec) error
- func (c *Client) ListCatalogs(ctx context.Context) ([]CatalogInfo, error)
- func (c *Client) ListEntities(ctx context.Context, catalogID string) ([]catalog.LiveEntity, error)
- type ClientInterface
- type FieldSpec
- type Option
Constants ¶
View Source
const ( DefaultBaseURL = "https://api.rootly.com" DefaultAPIPath = "/v1" DefaultMaxRetries = 5 MaxBatchSize = 100 DefaultPageSize = 250 UserAgent = "rootly-catalog-sync/0.1.0 (+https://github.com/rootlyhq/rootly-catalog-sync)" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BulkResult ¶
type CatalogInfo ¶
type CatalogSpec ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BulkDelete ¶
func (c *Client) BulkDelete(ctx context.Context, catalogID string, externalIDs []string) (*BulkResult, error)
BulkDelete deletes entities by external ID in batches of MaxBatchSize.
func (*Client) BulkUpsert ¶
func (c *Client) BulkUpsert(ctx context.Context, catalogID string, ents []catalog.DesiredEntity) (*BulkResult, error)
BulkUpsert creates or updates entities in batches of MaxBatchSize.
func (*Client) EnsureCatalog ¶
EnsureCatalog finds a catalog by name or creates it, returning the catalog ID.
func (*Client) EnsureFields ¶
EnsureFields ensures all desired fields exist on a catalog, creating any that are missing.
func (*Client) ListCatalogs ¶
func (c *Client) ListCatalogs(ctx context.Context) ([]CatalogInfo, error)
ListCatalogs returns all catalogs, paginating with page[number].
func (*Client) ListEntities ¶
ListEntities returns all entities for a catalog, using page-based pagination. It also fetches catalog fields to resolve property IDs to field names.
type ClientInterface ¶
type ClientInterface interface {
ListEntities(ctx context.Context, catalogID string) ([]catalog.LiveEntity, error)
BulkUpsert(ctx context.Context, catalogID string, ents []catalog.DesiredEntity) (*BulkResult, error)
BulkDelete(ctx context.Context, catalogID string, externalIDs []string) (*BulkResult, error)
EnsureCatalog(ctx context.Context, spec CatalogSpec) (string, error)
EnsureFields(ctx context.Context, catalogID string, fields []FieldSpec) error
ListCatalogs(ctx context.Context) ([]CatalogInfo, error)
}
type Option ¶
type Option func(*Client)
func WithAPIPath ¶
func WithBaseURL ¶
func WithHTTPClient ¶
func WithMaxRetries ¶
Click to show internal directories.
Click to hide internal directories.