Documentation
¶
Index ¶
- Variables
- func Bool(b bool) *bool
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func Int(i int) *int
- func Int64(i int64) *int64
- func Pointer[T any](v T) *T
- func String(s string) *string
- type Destinations
- func (s *Destinations) Create(ctx context.Context, destinationCreate components.DestinationCreate, ...) (*operations.CreateTenantDestinationResponse, error)
- func (s *Destinations) Delete(ctx context.Context, destinationID string, tenantID *string, ...) (*operations.DeleteTenantDestinationResponse, error)
- func (s *Destinations) Disable(ctx context.Context, destinationID string, tenantID *string, ...) (*operations.DisableTenantDestinationResponse, error)
- func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantID *string, ...) (*operations.EnableTenantDestinationResponse, error)
- func (s *Destinations) Get(ctx context.Context, destinationID string, tenantID *string, ...) (*operations.GetTenantDestinationResponse, error)
- func (s *Destinations) List(ctx context.Context, tenantID *string, type_ *operations.Type, ...) (*operations.ListTenantDestinationsResponse, error)
- func (s *Destinations) Update(ctx context.Context, destinationID string, ...) (*operations.UpdateTenantDestinationResponse, error)
- type Events
- func (s *Events) Get(ctx context.Context, eventID string, tenantID *string, ...) (*operations.GetTenantEventResponse, error)
- func (s *Events) GetByDestination(ctx context.Context, destinationID string, eventID string, tenantID *string, ...) (*operations.GetTenantEventByDestinationResponse, error)
- func (s *Events) List(ctx context.Context, tenantID *string, destinationID *operations.DestinationID, ...) (*operations.ListTenantEventsResponse, error)
- func (s *Events) ListByDestination(ctx context.Context, destinationID string, tenantID *string, ...) (*operations.ListTenantEventsByDestinationResponse, error)
- func (s *Events) ListDeliveries(ctx context.Context, eventID string, tenantID *string, ...) (*operations.ListTenantEventDeliveriesResponse, error)
- func (s *Events) Retry(ctx context.Context, destinationID string, eventID string, tenantID *string, ...) (*operations.RetryTenantEventResponse, error)
- type HTTPClient
- type Health
- type Outpost
- type Publish
- type SDKOption
- func WithClient(client HTTPClient) SDKOption
- func WithRetryConfig(retryConfig retry.Config) SDKOption
- func WithSecurity(security components.Security) SDKOption
- func WithSecuritySource(security func(context.Context) (components.Security, error)) SDKOption
- func WithServerIndex(serverIndex int) SDKOption
- func WithServerURL(serverURL string) SDKOption
- func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption
- func WithTenantID(tenantID string) SDKOption
- func WithTimeout(timeout time.Duration) SDKOption
- type Schemas
- func (s *Schemas) Get(ctx context.Context, type_ operations.GetTenantDestinationTypeSchemaType, ...) (*operations.GetTenantDestinationTypeSchemaResponse, error)
- func (s *Schemas) GetDestinationTypeJwt(ctx context.Context, type_ operations.GetDestinationTypeSchemaType, ...) (*operations.GetDestinationTypeSchemaResponse, error)
- func (s *Schemas) ListDestinationTypesJwt(ctx context.Context, opts ...operations.Option) (*operations.ListDestinationTypeSchemasJwtResponse, error)
- func (s *Schemas) ListTenantDestinationTypes(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.ListTenantDestinationTypeSchemasResponse, error)
- type Tenants
- func (s *Tenants) Delete(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.DeleteTenantResponse, error)
- func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.GetTenantResponse, error)
- func (s *Tenants) GetPortalURL(ctx context.Context, tenantID *string, theme *operations.Theme, ...) (*operations.GetTenantPortalURLResponse, error)
- func (s *Tenants) GetToken(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.GetTenantTokenResponse, error)
- func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.UpsertTenantResponse, error)
- type Topics
Constants ¶
This section is empty.
Variables ¶
var ServerList = []string{
"http://localhost:3333/api/v1",
}
ServerList contains the list of servers available to the SDK
Functions ¶
Types ¶
type Destinations ¶
type Destinations struct {
// contains filtered or unexported fields
}
Destinations are the endpoints where events are sent. Each destination is associated with a tenant and can be configured to receive specific event topics.
```json
{ "id": "des_12345", // Control plane generated ID or user provided ID "type": "webhooks", // Type of the destination "topics": ["user.created", "user.updated"], // Topics of events this destination is eligible for "config": { // Destination type specific configuration. Schema of depends on type "url": "https://example.com/webhooks/user" }, "credentials": { // Destination type specific credentials. AES encrypted. Schema depends on type "secret": "some***********" }, "disabled_at": null, // null or ISO date if disabled "created_at": "2024-01-01T00:00:00Z" // Date the destination was created }
```
The `topics` array can contain either a list of topics or a wildcard `*` implying that all topics are supported. If you do not wish to implement topics for your application, you set all destination topics to `*`.
By default all destination `credentials` are obfuscated and the values cannot be read. This does not apply to the `webhook` type destination secret and each destination can expose their own obfuscation logic.
func (*Destinations) Create ¶
func (s *Destinations) Create(ctx context.Context, destinationCreate components.DestinationCreate, tenantID *string, opts ...operations.Option) (*operations.CreateTenantDestinationResponse, error)
Create Destination Creates a new destination for the tenant. The request body structure depends on the `type`.
func (*Destinations) Delete ¶
func (s *Destinations) Delete(ctx context.Context, destinationID string, tenantID *string, opts ...operations.Option) (*operations.DeleteTenantDestinationResponse, error)
Delete Destination Deletes a specific destination.
func (*Destinations) Disable ¶
func (s *Destinations) Disable(ctx context.Context, destinationID string, tenantID *string, opts ...operations.Option) (*operations.DisableTenantDestinationResponse, error)
Disable Destination Disables a previously enabled destination.
func (*Destinations) Enable ¶
func (s *Destinations) Enable(ctx context.Context, destinationID string, tenantID *string, opts ...operations.Option) (*operations.EnableTenantDestinationResponse, error)
Enable Destination Enables a previously disabled destination.
func (*Destinations) Get ¶
func (s *Destinations) Get(ctx context.Context, destinationID string, tenantID *string, opts ...operations.Option) (*operations.GetTenantDestinationResponse, error)
Get Destination Retrieves details for a specific destination.
func (*Destinations) List ¶
func (s *Destinations) List(ctx context.Context, tenantID *string, type_ *operations.Type, topics *operations.Topics, opts ...operations.Option) (*operations.ListTenantDestinationsResponse, error)
List Destinations Return a list of the destinations for the tenant. The endpoint is not paged.
func (*Destinations) Update ¶
func (s *Destinations) Update(ctx context.Context, destinationID string, destinationUpdate components.DestinationUpdate, tenantID *string, opts ...operations.Option) (*operations.UpdateTenantDestinationResponse, error)
Update Destination Updates the configuration of an existing destination. The request body structure depends on the destination's `type`. Type itself cannot be updated. May return an OAuth redirect URL for certain types.
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events - Operations related to event history and deliveries.
func (*Events) Get ¶
func (s *Events) Get(ctx context.Context, eventID string, tenantID *string, opts ...operations.Option) (*operations.GetTenantEventResponse, error)
Get Event Retrieves details for a specific event.
func (*Events) GetByDestination ¶
func (s *Events) GetByDestination(ctx context.Context, destinationID string, eventID string, tenantID *string, opts ...operations.Option) (*operations.GetTenantEventByDestinationResponse, error)
GetByDestination - Get Event by Destination Retrieves a specific event associated with a specific destination for the tenant.
func (*Events) List ¶
func (s *Events) List(ctx context.Context, tenantID *string, destinationID *operations.DestinationID, status *operations.ListTenantEventsStatus, opts ...operations.Option) (*operations.ListTenantEventsResponse, error)
List Events Retrieves a list of events for the tenant, supporting cursor navigation (details TBD) and filtering.
func (*Events) ListByDestination ¶
func (s *Events) ListByDestination(ctx context.Context, destinationID string, tenantID *string, status *operations.ListTenantEventsByDestinationStatus, opts ...operations.Option) (*operations.ListTenantEventsByDestinationResponse, error)
ListByDestination - List Events by Destination Retrieves events associated with a specific destination for the tenant.
func (*Events) ListDeliveries ¶
func (s *Events) ListDeliveries(ctx context.Context, eventID string, tenantID *string, opts ...operations.Option) (*operations.ListTenantEventDeliveriesResponse, error)
ListDeliveries - List Event Delivery Attempts Retrieves a list of delivery attempts for a specific event, including response details.
func (*Events) Retry ¶
func (s *Events) Retry(ctx context.Context, destinationID string, eventID string, tenantID *string, opts ...operations.Option) (*operations.RetryTenantEventResponse, error)
Retry Event Delivery Triggers a retry for a failed event delivery.
type HTTPClient ¶
HTTPClient provides an interface for suplying the SDK with a custom HTTP client
type Health ¶
type Health struct {
// contains filtered or unexported fields
}
API Health Check
func (*Health) Check ¶
func (s *Health) Check(ctx context.Context, opts ...operations.Option) (*operations.HealthCheckResponse, error)
Health Check Simple health check endpoint.
type Outpost ¶
type Outpost struct { // API Health Check Health *Health // The API segments resources per `tenant`. A tenant represents a user/team/organization in your product. The provided value determines the tenant's ID, which can be any string representation. // // If your system is not multi-tenant, create a single tenant with a hard-code tenant ID upon initialization. If your system has a single tenant but multiple environments, create a tenant per environment, like `live` and `test`. // Tenants *Tenants // Destinations are the endpoints where events are sent. Each destination is associated with a tenant and can be configured to receive specific event topics. // // “`json // { // "id": "des_12345", // Control plane generated ID or user provided ID // "type": "webhooks", // Type of the destination // "topics": ["user.created", "user.updated"], // Topics of events this destination is eligible for // "config": { // // Destination type specific configuration. Schema of depends on type // "url": "https://example.com/webhooks/user" // }, // "credentials": { // // Destination type specific credentials. AES encrypted. Schema depends on type // "secret": "some***********" // }, // "disabled_at": null, // null or ISO date if disabled // "created_at": "2024-01-01T00:00:00Z" // Date the destination was created // } // “` // // The `topics` array can contain either a list of topics or a wildcard `*` implying that all topics are supported. If you do not wish to implement topics for your application, you set all destination topics to `*`. // // By default all destination `credentials` are obfuscated and the values cannot be read. This does not apply to the `webhook` type destination secret and each destination can expose their own obfuscation logic. // Destinations *Destinations // Operations for publishing events. Publish *Publish // Operations for retrieving destination type schemas. Schemas *Schemas // Operations for retrieving available event topics. Topics *Topics // Operations related to event history and deliveries. Events *Events // contains filtered or unexported fields }
Outpost API: The Outpost API is a REST-based JSON API for managing tenants, destinations, and publishing events.
type Publish ¶
type Publish struct {
// contains filtered or unexported fields
}
Publish - Operations for publishing events.
func (*Publish) Event ¶
func (s *Publish) Event(ctx context.Context, request components.PublishRequest, opts ...operations.Option) (*operations.PublishEventResponse, error)
Publish Event Publishes an event to the specified topic, potentially routed to a specific destination. Requires Admin API Key.
type SDKOption ¶
type SDKOption func(*Outpost)
func WithClient ¶
func WithClient(client HTTPClient) SDKOption
WithClient allows the overriding of the default HTTP client used by the SDK
func WithRetryConfig ¶
func WithSecurity ¶
func WithSecurity(security components.Security) SDKOption
WithSecurity configures the SDK to use the provided security details
func WithSecuritySource ¶
WithSecuritySource configures the SDK to invoke the Security Source function on each method call to determine authentication
func WithServerIndex ¶
WithServerIndex allows the overriding of the default server by index
func WithServerURL ¶
WithServerURL allows the overriding of the default server URL
func WithTemplatedServerURL ¶
WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters
func WithTenantID ¶
WithTenantID allows setting the TenantID parameter for all supported operations
func WithTimeout ¶
WithTimeout Optional request timeout applied to each operation
type Schemas ¶
type Schemas struct {
// contains filtered or unexported fields
}
Schemas - Operations for retrieving destination type schemas.
func (*Schemas) Get ¶
func (s *Schemas) Get(ctx context.Context, type_ operations.GetTenantDestinationTypeSchemaType, tenantID *string, opts ...operations.Option) (*operations.GetTenantDestinationTypeSchemaResponse, error)
Get Destination Type Schema (for Tenant) Returns the input schema for a specific destination type. Requires Admin API Key or Tenant JWT.
func (*Schemas) GetDestinationTypeJwt ¶
func (s *Schemas) GetDestinationTypeJwt(ctx context.Context, type_ operations.GetDestinationTypeSchemaType, opts ...operations.Option) (*operations.GetDestinationTypeSchemaResponse, error)
GetDestinationTypeJwt - Get Destination Type Schema Returns the input schema for a specific destination type.
func (*Schemas) ListDestinationTypesJwt ¶
func (s *Schemas) ListDestinationTypesJwt(ctx context.Context, opts ...operations.Option) (*operations.ListDestinationTypeSchemasJwtResponse, error)
ListDestinationTypesJwt - List Destination Type Schemas (JWT Auth) Returns a list of JSON-based input schemas for each available destination type (infers tenant from JWT).
func (*Schemas) ListTenantDestinationTypes ¶
func (s *Schemas) ListTenantDestinationTypes(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.ListTenantDestinationTypeSchemasResponse, error)
ListTenantDestinationTypes - List Destination Type Schemas (for Tenant) Returns a list of JSON-based input schemas for each available destination type. Requires Admin API Key or Tenant JWT.
type Tenants ¶
type Tenants struct {
// contains filtered or unexported fields
}
Tenants - The API segments resources per `tenant`. A tenant represents a user/team/organization in your product. The provided value determines the tenant's ID, which can be any string representation.
If your system is not multi-tenant, create a single tenant with a hard-code tenant ID upon initialization. If your system has a single tenant but multiple environments, create a tenant per environment, like `live` and `test`.
func (*Tenants) Delete ¶
func (s *Tenants) Delete(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.DeleteTenantResponse, error)
Delete Tenant Deletes the tenant and all associated destinations.
func (*Tenants) Get ¶
func (s *Tenants) Get(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.GetTenantResponse, error)
Get Tenant Retrieves details for a specific tenant.
func (*Tenants) GetPortalURL ¶
func (s *Tenants) GetPortalURL(ctx context.Context, tenantID *string, theme *operations.Theme, opts ...operations.Option) (*operations.GetTenantPortalURLResponse, error)
GetPortalURL - Get Portal Redirect URL Returns a redirect URL containing a JWT to authenticate the user with the portal.
func (*Tenants) GetToken ¶
func (s *Tenants) GetToken(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.GetTenantTokenResponse, error)
GetToken - Get Tenant JWT Token Returns a JWT token scoped to the tenant for safe browser API calls.
func (*Tenants) Upsert ¶
func (s *Tenants) Upsert(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.UpsertTenantResponse, error)
Upsert - Create or Update Tenant Idempotently creates or updates a tenant. Required before associating destinations.
type Topics ¶
type Topics struct {
// contains filtered or unexported fields
}
Topics - Operations for retrieving available event topics.
func (*Topics) List ¶
func (s *Topics) List(ctx context.Context, tenantID *string, opts ...operations.Option) (*operations.ListTenantTopicsResponse, error)
List Available Topics (for Tenant) Returns a list of available event topics configured in the Outpost instance. Requires Admin API Key or Tenant JWT.
func (*Topics) ListJwt ¶
func (s *Topics) ListJwt(ctx context.Context, opts ...operations.Option) (*operations.ListTopicsResponse, error)
ListJwt - List Available Topics) Returns a list of available event topics configured in the Outpost instance.