Documentation
¶
Index ¶
- Constants
- type ASN
- type ASNParam
- type AuditLog
- type AuditLogAction
- type AuditLogActor
- type AuditLogActorType
- type AuditLogOwner
- type AuditLogResource
- type CertificateCA
- type CertificateRequestType
- type CloudflareTunnel
- type CloudflareTunnelConfigSrc
- type CloudflareTunnelConnection
- type CloudflareTunnelStatus
- type CloudflareTunnelTunType
- type Error
- type ErrorData
- type ErrorDataSource
- type K2Service
- type Member
- type MemberPoliciesAccess
- type MemberPoliciesPermissionGroup
- type MemberPoliciesPermissionGroupsMeta
- type MemberPoliciesResourceGroup
- type MemberPoliciesResourceGroupsMeta
- type MemberPoliciesResourceGroupsScope
- type MemberPoliciesResourceGroupsScopeObject
- type MemberPolicy
- type MemberStatus
- type MemberUser
- type Permission
- type PermissionGrant
- type PermissionGrantParam
- type RatePlan
- type RatePlanID
- type RatePlanParam
- type ResponseInfo
- type ResponseInfoSource
- type Role
- type RoleParam
- type RolePermissions
- type RolePermissionsParam
- type SortDirection
- type StreamDeleteParams
- type StreamDeleteResponse
- type StreamDeleteResponseEnvelope
- type StreamDeleteResponseEnvelopeErrors
- type StreamDeleteResponseEnvelopeMessages
- type StreamGetParams
- type StreamGetResponse
- type StreamGetResponseEnvelope
- type StreamGetResponseEnvelopeErrors
- type StreamGetResponseEnvelopeMessages
- type StreamGetResponseHTTP
- type StreamGetResponseHTTPCORS
- type StreamGetResponseWorkerBinding
- type StreamGetResponseWorkerBindingEnabled
- type StreamGetResponseWorkerBindingEnabledEnabled
- type StreamGetResponseWorkerBindingUnion
- type StreamListParams
- type StreamListResponse
- type StreamListResponseHTTP
- type StreamListResponseHTTPCORS
- type StreamListResponseWorkerBinding
- type StreamListResponseWorkerBindingEnabled
- type StreamListResponseWorkerBindingEnabledEnabled
- type StreamListResponseWorkerBindingUnion
- type StreamNewParams
- type StreamNewParamsHTTP
- type StreamNewParamsHTTPCORS
- type StreamNewParamsWorkerBinding
- type StreamNewParamsWorkerBindingEnabled
- type StreamNewParamsWorkerBindingEnabledEnabled
- type StreamNewParamsWorkerBindingUnion
- type StreamNewResponse
- type StreamNewResponseEnvelope
- type StreamNewResponseEnvelopeErrors
- type StreamNewResponseEnvelopeMessages
- type StreamNewResponseHTTP
- type StreamNewResponseHTTPCORS
- type StreamNewResponseWorkerBinding
- type StreamNewResponseWorkerBindingEnabled
- type StreamNewResponseWorkerBindingEnabledEnabled
- type StreamNewResponseWorkerBindingUnion
- type StreamService
- func (r *StreamService) Delete(ctx context.Context, streamID string, body StreamDeleteParams, ...) (res *StreamDeleteResponse, err error)
- func (r *StreamService) Get(ctx context.Context, streamID string, query StreamGetParams, ...) (res *StreamGetResponse, err error)
- func (r *StreamService) List(ctx context.Context, params StreamListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[StreamListResponse], err error)
- func (r *StreamService) ListAutoPaging(ctx context.Context, params StreamListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[StreamListResponse]
- func (r *StreamService) New(ctx context.Context, params StreamNewParams, opts ...option.RequestOption) (res *StreamNewResponse, err error)
- func (r *StreamService) Update(ctx context.Context, streamID string, params StreamUpdateParams, ...) (res *StreamUpdateResponse, err error)
- type StreamSubscriptionListParams
- type StreamSubscriptionListResponse
- type StreamSubscriptionListResponseLag
- type StreamSubscriptionListResponseLagStatus
- type StreamSubscriptionListResponseStartAt
- type StreamSubscriptionListResponseStartAtType
- type StreamSubscriptionService
- func (r *StreamSubscriptionService) List(ctx context.Context, streamID string, query StreamSubscriptionListParams, ...) (res *pagination.SinglePage[StreamSubscriptionListResponse], err error)
- func (r *StreamSubscriptionService) ListAutoPaging(ctx context.Context, streamID string, query StreamSubscriptionListParams, ...) *pagination.SinglePageAutoPager[StreamSubscriptionListResponse]
- type StreamUpdateParams
- type StreamUpdateParamsHTTP
- type StreamUpdateParamsHTTPCORS
- type StreamUpdateParamsWorkerBinding
- type StreamUpdateParamsWorkerBindingEnabled
- type StreamUpdateParamsWorkerBindingEnabledEnabled
- type StreamUpdateParamsWorkerBindingUnion
- type StreamUpdateResponse
- type StreamUpdateResponseEnvelope
- type StreamUpdateResponseEnvelopeErrors
- type StreamUpdateResponseEnvelopeMessages
- type StreamUpdateResponseHTTP
- type StreamUpdateResponseHTTPCORS
- type StreamUpdateResponseWorkerBinding
- type StreamUpdateResponseWorkerBindingEnabled
- type StreamUpdateResponseWorkerBindingEnabledEnabled
- type StreamUpdateResponseWorkerBindingUnion
- type Subscription
- type SubscriptionFrequency
- type SubscriptionParam
- type SubscriptionState
- type Token
- type TokenCondition
- type TokenConditionCIDRList
- type TokenConditionCIDRListParam
- type TokenConditionParam
- type TokenConditionRequestIP
- type TokenConditionRequestIPParam
- type TokenParam
- type TokenPolicy
- type TokenPolicyEffect
- type TokenPolicyParam
- type TokenPolicyPermissionGroup
- type TokenPolicyPermissionGroupParam
- type TokenPolicyPermissionGroupsMeta
- type TokenPolicyPermissionGroupsMetaParam
- type TokenPolicyResourcesIAMResourcesTypeObjectNested
- type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam
- type TokenPolicyResourcesIAMResourcesTypeObjectString
- type TokenPolicyResourcesIAMResourcesTypeObjectStringParam
- type TokenPolicyResourcesUnion
- type TokenPolicyResourcesUnionParam
- type TokenStatus
- type TokenValue
Constants ¶
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
This is an alias to an internal value.
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
This is an alias to an internal value.
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
This is an alias to an internal value.
const CertificateCADigicert = shared.CertificateCADigicert
This is an alias to an internal value.
const CertificateCAGoogle = shared.CertificateCAGoogle
This is an alias to an internal value.
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt
This is an alias to an internal value.
const CertificateCASSLCom = shared.CertificateCASSLCom
This is an alias to an internal value.
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate
This is an alias to an internal value.
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC
This is an alias to an internal value.
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA
This is an alias to an internal value.
const CloudflareTunnelConfigSrcCloudflare = shared.CloudflareTunnelConfigSrcCloudflare
This is an alias to an internal value.
const CloudflareTunnelConfigSrcLocal = shared.CloudflareTunnelConfigSrcLocal
This is an alias to an internal value.
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded
This is an alias to an internal value.
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown
This is an alias to an internal value.
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy
This is an alias to an internal value.
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive
This is an alias to an internal value.
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
This is an alias to an internal value.
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
This is an alias to an internal value.
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
This is an alias to an internal value.
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
This is an alias to an internal value.
const CloudflareTunnelTunTypeMagic = shared.CloudflareTunnelTunTypeMagic
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARP = shared.CloudflareTunnelTunTypeWARP
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
This is an alias to an internal value.
const MemberPoliciesAccessAllow = shared.MemberPoliciesAccessAllow
This is an alias to an internal value.
const MemberPoliciesAccessDeny = shared.MemberPoliciesAccessDeny
This is an alias to an internal value.
const MemberStatusAccepted = shared.MemberStatusAccepted
This is an alias to an internal value.
const MemberStatusPending = shared.MemberStatusPending
This is an alias to an internal value.
const RatePlanIDBusiness = shared.RatePlanIDBusiness
This is an alias to an internal value.
const RatePlanIDEnterprise = shared.RatePlanIDEnterprise
This is an alias to an internal value.
const RatePlanIDFree = shared.RatePlanIDFree
This is an alias to an internal value.
const RatePlanIDLite = shared.RatePlanIDLite
This is an alias to an internal value.
const RatePlanIDPartnersBusiness = shared.RatePlanIDPartnersBusiness
This is an alias to an internal value.
const RatePlanIDPartnersEnterprise = shared.RatePlanIDPartnersEnterprise
This is an alias to an internal value.
const RatePlanIDPartnersFree = shared.RatePlanIDPartnersFree
This is an alias to an internal value.
const RatePlanIDPartnersPro = shared.RatePlanIDPartnersPro
This is an alias to an internal value.
const RatePlanIDPro = shared.RatePlanIDPro
This is an alias to an internal value.
const RatePlanIDProPlus = shared.RatePlanIDProPlus
This is an alias to an internal value.
const SortDirectionAsc = shared.SortDirectionAsc
This is an alias to an internal value.
const SortDirectionDesc = shared.SortDirectionDesc
This is an alias to an internal value.
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly
This is an alias to an internal value.
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly
This is an alias to an internal value.
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly
This is an alias to an internal value.
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly
This is an alias to an internal value.
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment
This is an alias to an internal value.
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled
This is an alias to an internal value.
const SubscriptionStateExpired = shared.SubscriptionStateExpired
This is an alias to an internal value.
const SubscriptionStateFailed = shared.SubscriptionStateFailed
This is an alias to an internal value.
const SubscriptionStatePaid = shared.SubscriptionStatePaid
This is an alias to an internal value.
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned
This is an alias to an internal value.
const SubscriptionStateTrial = shared.SubscriptionStateTrial
This is an alias to an internal value.
const TokenPolicyEffectAllow = shared.TokenPolicyEffectAllow
This is an alias to an internal value.
const TokenPolicyEffectDeny = shared.TokenPolicyEffectDeny
This is an alias to an internal value.
const TokenStatusActive = shared.TokenStatusActive
This is an alias to an internal value.
const TokenStatusDisabled = shared.TokenStatusDisabled
This is an alias to an internal value.
const TokenStatusExpired = shared.TokenStatusExpired
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLogAction ¶
type AuditLogAction = shared.AuditLogAction
This is an alias to an internal type.
type AuditLogActor ¶
type AuditLogActor = shared.AuditLogActor
This is an alias to an internal type.
type AuditLogActorType ¶
type AuditLogActorType = shared.AuditLogActorType
The type of actor, whether a User, Cloudflare Admin, or an Automated System.
This is an alias to an internal type.
type AuditLogOwner ¶
type AuditLogOwner = shared.AuditLogOwner
This is an alias to an internal type.
type AuditLogResource ¶
type AuditLogResource = shared.AuditLogResource
This is an alias to an internal type.
type CertificateCA ¶
type CertificateCA = shared.CertificateCA
The Certificate Authority that will issue the certificate.
This is an alias to an internal type.
type CertificateRequestType ¶
type CertificateRequestType = shared.CertificateRequestType
Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).
This is an alias to an internal type.
type CloudflareTunnel ¶
type CloudflareTunnel = shared.CloudflareTunnel
A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
This is an alias to an internal type.
type CloudflareTunnelConfigSrc ¶
type CloudflareTunnelConfigSrc = shared.CloudflareTunnelConfigSrc
Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard.
This is an alias to an internal type.
type CloudflareTunnelConnection ¶
type CloudflareTunnelConnection = shared.CloudflareTunnelConnection
This is an alias to an internal type.
type CloudflareTunnelStatus ¶
type CloudflareTunnelStatus = shared.CloudflareTunnelStatus
The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).
This is an alias to an internal type.
type CloudflareTunnelTunType ¶
type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
The type of tunnel.
This is an alias to an internal type.
type ErrorDataSource ¶
type ErrorDataSource = shared.ErrorDataSource
This is an alias to an internal type.
type K2Service ¶
type K2Service struct {
Options []option.RequestOption
Streams *StreamService
}
K2Service contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewK2Service method instead.
func NewK2Service ¶
func NewK2Service(opts ...option.RequestOption) (r *K2Service)
NewK2Service generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type MemberPoliciesAccess ¶
type MemberPoliciesAccess = shared.MemberPoliciesAccess
Allow or deny operations against the resources.
This is an alias to an internal type.
type MemberPoliciesPermissionGroup ¶
type MemberPoliciesPermissionGroup = shared.MemberPoliciesPermissionGroup
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type MemberPoliciesPermissionGroupsMeta ¶
type MemberPoliciesPermissionGroupsMeta = shared.MemberPoliciesPermissionGroupsMeta
Attributes associated to the permission group.
This is an alias to an internal type.
type MemberPoliciesResourceGroup ¶
type MemberPoliciesResourceGroup = shared.MemberPoliciesResourceGroup
A group of scoped resources.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsMeta ¶
type MemberPoliciesResourceGroupsMeta = shared.MemberPoliciesResourceGroupsMeta
Attributes associated to the resource group.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsScope ¶
type MemberPoliciesResourceGroupsScope = shared.MemberPoliciesResourceGroupsScope
A scope is a combination of scope objects which provides additional context.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsScopeObject ¶
type MemberPoliciesResourceGroupsScopeObject = shared.MemberPoliciesResourceGroupsScopeObject
A scope object represents any resource that can have actions applied against invite.
This is an alias to an internal type.
type MemberStatus ¶
type MemberStatus = shared.MemberStatus
A member's status in the account.
This is an alias to an internal type.
type MemberUser ¶
type MemberUser = shared.MemberUser
Details of the user associated to the membership.
This is an alias to an internal type.
type PermissionGrant ¶
type PermissionGrant = shared.PermissionGrant
This is an alias to an internal type.
type PermissionGrantParam ¶
type PermissionGrantParam = shared.PermissionGrantParam
This is an alias to an internal type.
type RatePlanID ¶
type RatePlanID = shared.RatePlanID
The ID of the rate plan.
This is an alias to an internal type.
type RatePlanParam ¶
type RatePlanParam = shared.RatePlanParam
The rate plan applied to the subscription.
This is an alias to an internal type.
type ResponseInfoSource ¶
type ResponseInfoSource = shared.ResponseInfoSource
This is an alias to an internal type.
type RolePermissions ¶
type RolePermissions = shared.RolePermissions
This is an alias to an internal type.
type RolePermissionsParam ¶
type RolePermissionsParam = shared.RolePermissionsParam
This is an alias to an internal type.
type SortDirection ¶
type SortDirection = shared.SortDirection
Direction to order DNS records in.
This is an alias to an internal type.
type StreamDeleteParams ¶
type StreamDeleteResponse ¶
type StreamDeleteResponse = interface{}
type StreamDeleteResponseEnvelope ¶
type StreamDeleteResponseEnvelope struct {
Errors []StreamDeleteResponseEnvelopeErrors `json:"errors" api:"required"`
Messages []StreamDeleteResponseEnvelopeMessages `json:"messages" api:"required"`
Result StreamDeleteResponse `json:"result" api:"required"`
// Indicates whether the API call was successful.
Success bool `json:"success" api:"required"`
JSON streamDeleteResponseEnvelopeJSON `json:"-"`
}
func (*StreamDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *StreamDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type StreamDeleteResponseEnvelopeErrors ¶
type StreamDeleteResponseEnvelopeErrors struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`
JSON streamDeleteResponseEnvelopeErrorsJSON `json:"-"`
}
func (*StreamDeleteResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *StreamDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type StreamDeleteResponseEnvelopeMessages ¶
type StreamDeleteResponseEnvelopeMessages struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`
JSON streamDeleteResponseEnvelopeMessagesJSON `json:"-"`
}
func (*StreamDeleteResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *StreamDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type StreamGetParams ¶
type StreamGetResponse ¶
type StreamGetResponse struct {
// Specifies the public ID of the K2 stream.
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Indicates the base HTTP endpoint for producing and consuming records.
Endpoint string `json:"endpoint" api:"required" format:"uri"`
// Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`,
// so enabling it again restores them.
HTTP StreamGetResponseHTTP `json:"http" api:"required"`
ModifiedAt time.Time `json:"modified_at" api:"required" format:"date-time"`
// Indicates the name of the K2 stream.
Name string `json:"name" api:"required"`
// Shows the configured record retention period from 1 hour (3600 seconds) to 30
// days (2592000 seconds), inclusive.
RetentionSeconds int64 `json:"retention_seconds" api:"required"`
WorkerBinding StreamGetResponseWorkerBinding `json:"worker_binding" api:"required"`
JSON streamGetResponseJSON `json:"-"`
}
func (*StreamGetResponse) UnmarshalJSON ¶
func (r *StreamGetResponse) UnmarshalJSON(data []byte) (err error)
type StreamGetResponseEnvelope ¶
type StreamGetResponseEnvelope struct {
Errors []StreamGetResponseEnvelopeErrors `json:"errors" api:"required"`
Messages []StreamGetResponseEnvelopeMessages `json:"messages" api:"required"`
Result StreamGetResponse `json:"result" api:"required"`
// Indicates whether the API call was successful.
Success bool `json:"success" api:"required"`
JSON streamGetResponseEnvelopeJSON `json:"-"`
}
func (*StreamGetResponseEnvelope) UnmarshalJSON ¶
func (r *StreamGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type StreamGetResponseEnvelopeErrors ¶
type StreamGetResponseEnvelopeErrors struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`
JSON streamGetResponseEnvelopeErrorsJSON `json:"-"`
}
func (*StreamGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *StreamGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type StreamGetResponseEnvelopeMessages ¶
type StreamGetResponseEnvelopeMessages struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`
JSON streamGetResponseEnvelopeMessagesJSON `json:"-"`
}
func (*StreamGetResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *StreamGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type StreamGetResponseHTTP ¶
type StreamGetResponseHTTP struct {
// Indicates whether the HTTP endpoint accepts records.
Enabled bool `json:"enabled" api:"required"`
// Indicates whether the HTTP endpoint requires an API token with K2 produce
// permission. When false, the endpoint accepts unauthenticated records. Defaults
// to true when HTTP is enabled without a stored value.
Authentication bool `json:"authentication"`
CORS StreamGetResponseHTTPCORS `json:"cors"`
JSON streamGetResponseHTTPJSON `json:"-"`
}
Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`, so enabling it again restores them.
func (*StreamGetResponseHTTP) UnmarshalJSON ¶
func (r *StreamGetResponseHTTP) UnmarshalJSON(data []byte) (err error)
type StreamGetResponseHTTPCORS ¶
type StreamGetResponseHTTPCORS struct {
// Allows browser requests from these HTTP or HTTPS origins. Use a wildcard only as
// the sole origin. An empty list blocks cross-origin browser requests. Defaults to
// `['*']` when HTTP is enabled without stored origins.
Origins []string `json:"origins"`
JSON streamGetResponseHttpcorsJSON `json:"-"`
}
func (*StreamGetResponseHTTPCORS) UnmarshalJSON ¶
func (r *StreamGetResponseHTTPCORS) UnmarshalJSON(data []byte) (err error)
type StreamGetResponseWorkerBinding ¶
type StreamGetResponseWorkerBinding struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled StreamGetResponseWorkerBindingEnabled `json:"enabled" api:"required"`
JSON streamGetResponseWorkerBindingJSON `json:"-"`
// contains filtered or unexported fields
}
func (StreamGetResponseWorkerBinding) AsUnion ¶
func (r StreamGetResponseWorkerBinding) AsUnion() StreamGetResponseWorkerBindingUnion
AsUnion returns a StreamGetResponseWorkerBindingUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are StreamGetResponseWorkerBindingEnabled, StreamGetResponseWorkerBindingEnabled.
func (*StreamGetResponseWorkerBinding) UnmarshalJSON ¶
func (r *StreamGetResponseWorkerBinding) UnmarshalJSON(data []byte) (err error)
type StreamGetResponseWorkerBindingEnabled ¶
type StreamGetResponseWorkerBindingEnabled struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled StreamGetResponseWorkerBindingEnabledEnabled `json:"enabled" api:"required"`
JSON streamGetResponseWorkerBindingEnabledJSON `json:"-"`
}
func (*StreamGetResponseWorkerBindingEnabled) UnmarshalJSON ¶
func (r *StreamGetResponseWorkerBindingEnabled) UnmarshalJSON(data []byte) (err error)
type StreamGetResponseWorkerBindingEnabledEnabled ¶
type StreamGetResponseWorkerBindingEnabledEnabled bool
Indicates whether Workers bindings can produce records to the stream.
const (
StreamGetResponseWorkerBindingEnabledEnabledFalse StreamGetResponseWorkerBindingEnabledEnabled = false
)
func (StreamGetResponseWorkerBindingEnabledEnabled) IsKnown ¶
func (r StreamGetResponseWorkerBindingEnabledEnabled) IsKnown() bool
type StreamGetResponseWorkerBindingUnion ¶
type StreamGetResponseWorkerBindingUnion interface {
// contains filtered or unexported methods
}
Union satisfied by StreamGetResponseWorkerBindingEnabled or StreamGetResponseWorkerBindingEnabled.
type StreamListParams ¶
type StreamListParams struct {
// Specifies the public ID of the account.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Filters K2 streams by name using a case-insensitive substring.
Name param.Field[string] `query:"name"`
Page param.Field[int64] `query:"page"`
PerPage param.Field[int64] `query:"per_page"`
}
func (StreamListParams) URLQuery ¶
func (r StreamListParams) URLQuery() (v url.Values)
URLQuery serializes StreamListParams's query parameters as `url.Values`.
type StreamListResponse ¶
type StreamListResponse struct {
// Specifies the public ID of the K2 stream.
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Indicates the base HTTP endpoint for producing and consuming records.
Endpoint string `json:"endpoint" api:"required" format:"uri"`
// Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`,
// so enabling it again restores them.
HTTP StreamListResponseHTTP `json:"http" api:"required"`
ModifiedAt time.Time `json:"modified_at" api:"required" format:"date-time"`
// Indicates the name of the K2 stream.
Name string `json:"name" api:"required"`
// Shows the configured record retention period from 1 hour (3600 seconds) to 30
// days (2592000 seconds), inclusive.
RetentionSeconds int64 `json:"retention_seconds" api:"required"`
WorkerBinding StreamListResponseWorkerBinding `json:"worker_binding" api:"required"`
JSON streamListResponseJSON `json:"-"`
}
func (*StreamListResponse) UnmarshalJSON ¶
func (r *StreamListResponse) UnmarshalJSON(data []byte) (err error)
type StreamListResponseHTTP ¶
type StreamListResponseHTTP struct {
// Indicates whether the HTTP endpoint accepts records.
Enabled bool `json:"enabled" api:"required"`
// Indicates whether the HTTP endpoint requires an API token with K2 produce
// permission. When false, the endpoint accepts unauthenticated records. Defaults
// to true when HTTP is enabled without a stored value.
Authentication bool `json:"authentication"`
CORS StreamListResponseHTTPCORS `json:"cors"`
JSON streamListResponseHTTPJSON `json:"-"`
}
Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`, so enabling it again restores them.
func (*StreamListResponseHTTP) UnmarshalJSON ¶
func (r *StreamListResponseHTTP) UnmarshalJSON(data []byte) (err error)
type StreamListResponseHTTPCORS ¶
type StreamListResponseHTTPCORS struct {
// Allows browser requests from these HTTP or HTTPS origins. Use a wildcard only as
// the sole origin. An empty list blocks cross-origin browser requests. Defaults to
// `['*']` when HTTP is enabled without stored origins.
Origins []string `json:"origins"`
JSON streamListResponseHttpcorsJSON `json:"-"`
}
func (*StreamListResponseHTTPCORS) UnmarshalJSON ¶
func (r *StreamListResponseHTTPCORS) UnmarshalJSON(data []byte) (err error)
type StreamListResponseWorkerBinding ¶
type StreamListResponseWorkerBinding struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled StreamListResponseWorkerBindingEnabled `json:"enabled" api:"required"`
JSON streamListResponseWorkerBindingJSON `json:"-"`
// contains filtered or unexported fields
}
func (StreamListResponseWorkerBinding) AsUnion ¶
func (r StreamListResponseWorkerBinding) AsUnion() StreamListResponseWorkerBindingUnion
AsUnion returns a StreamListResponseWorkerBindingUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are StreamListResponseWorkerBindingEnabled, StreamListResponseWorkerBindingEnabled.
func (*StreamListResponseWorkerBinding) UnmarshalJSON ¶
func (r *StreamListResponseWorkerBinding) UnmarshalJSON(data []byte) (err error)
type StreamListResponseWorkerBindingEnabled ¶
type StreamListResponseWorkerBindingEnabled struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled StreamListResponseWorkerBindingEnabledEnabled `json:"enabled" api:"required"`
JSON streamListResponseWorkerBindingEnabledJSON `json:"-"`
}
func (*StreamListResponseWorkerBindingEnabled) UnmarshalJSON ¶
func (r *StreamListResponseWorkerBindingEnabled) UnmarshalJSON(data []byte) (err error)
type StreamListResponseWorkerBindingEnabledEnabled ¶
type StreamListResponseWorkerBindingEnabledEnabled bool
Indicates whether Workers bindings can produce records to the stream.
const (
StreamListResponseWorkerBindingEnabledEnabledFalse StreamListResponseWorkerBindingEnabledEnabled = false
)
func (StreamListResponseWorkerBindingEnabledEnabled) IsKnown ¶
func (r StreamListResponseWorkerBindingEnabledEnabled) IsKnown() bool
type StreamListResponseWorkerBindingUnion ¶
type StreamListResponseWorkerBindingUnion interface {
// contains filtered or unexported methods
}
Union satisfied by StreamListResponseWorkerBindingEnabled or StreamListResponseWorkerBindingEnabled.
type StreamNewParams ¶
type StreamNewParams struct {
// Specifies the public ID of the account.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Specifies the name of the K2 stream.
Name param.Field[string] `json:"name" api:"required"`
// Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`,
// so enabling it again restores them.
HTTP param.Field[StreamNewParamsHTTP] `json:"http"`
// Sets the record retention period from 1 hour (3600 seconds) to 30 days (2592000
// seconds), inclusive.
RetentionSeconds param.Field[int64] `json:"retention_seconds"`
WorkerBinding param.Field[StreamNewParamsWorkerBindingUnion] `json:"worker_binding"`
}
func (StreamNewParams) MarshalJSON ¶
func (r StreamNewParams) MarshalJSON() (data []byte, err error)
type StreamNewParamsHTTP ¶
type StreamNewParamsHTTP struct {
// Indicates whether the HTTP endpoint accepts records.
Enabled param.Field[bool] `json:"enabled" api:"required"`
// Indicates whether the HTTP endpoint requires an API token with K2 produce
// permission. When false, the endpoint accepts unauthenticated records. Defaults
// to true when HTTP is enabled without a stored value.
Authentication param.Field[bool] `json:"authentication"`
CORS param.Field[StreamNewParamsHTTPCORS] `json:"cors"`
}
Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`, so enabling it again restores them.
func (StreamNewParamsHTTP) MarshalJSON ¶
func (r StreamNewParamsHTTP) MarshalJSON() (data []byte, err error)
type StreamNewParamsHTTPCORS ¶
type StreamNewParamsHTTPCORS struct {
// Allows browser requests from these HTTP or HTTPS origins. Use a wildcard only as
// the sole origin. An empty list blocks cross-origin browser requests. Defaults to
// `['*']` when HTTP is enabled without stored origins.
Origins param.Field[[]string] `json:"origins"`
}
func (StreamNewParamsHTTPCORS) MarshalJSON ¶
func (r StreamNewParamsHTTPCORS) MarshalJSON() (data []byte, err error)
type StreamNewParamsWorkerBinding ¶
type StreamNewParamsWorkerBinding struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled param.Field[StreamNewParamsWorkerBindingEnabled] `json:"enabled" api:"required"`
}
func (StreamNewParamsWorkerBinding) MarshalJSON ¶
func (r StreamNewParamsWorkerBinding) MarshalJSON() (data []byte, err error)
type StreamNewParamsWorkerBindingEnabled ¶
type StreamNewParamsWorkerBindingEnabled struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled param.Field[StreamNewParamsWorkerBindingEnabledEnabled] `json:"enabled" api:"required"`
}
func (StreamNewParamsWorkerBindingEnabled) MarshalJSON ¶
func (r StreamNewParamsWorkerBindingEnabled) MarshalJSON() (data []byte, err error)
type StreamNewParamsWorkerBindingEnabledEnabled ¶
type StreamNewParamsWorkerBindingEnabledEnabled bool
Indicates whether Workers bindings can produce records to the stream.
const (
StreamNewParamsWorkerBindingEnabledEnabledFalse StreamNewParamsWorkerBindingEnabledEnabled = false
)
func (StreamNewParamsWorkerBindingEnabledEnabled) IsKnown ¶
func (r StreamNewParamsWorkerBindingEnabledEnabled) IsKnown() bool
type StreamNewParamsWorkerBindingUnion ¶
type StreamNewParamsWorkerBindingUnion interface {
// contains filtered or unexported methods
}
Satisfied by k2.StreamNewParamsWorkerBindingEnabled, k2.StreamNewParamsWorkerBindingEnabled, StreamNewParamsWorkerBinding.
type StreamNewResponse ¶
type StreamNewResponse struct {
// Specifies the public ID of the K2 stream.
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Indicates the base HTTP endpoint for producing and consuming records.
Endpoint string `json:"endpoint" api:"required" format:"uri"`
// Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`,
// so enabling it again restores them.
HTTP StreamNewResponseHTTP `json:"http" api:"required"`
ModifiedAt time.Time `json:"modified_at" api:"required" format:"date-time"`
// Indicates the name of the K2 stream.
Name string `json:"name" api:"required"`
// Shows the configured record retention period from 1 hour (3600 seconds) to 30
// days (2592000 seconds), inclusive.
RetentionSeconds int64 `json:"retention_seconds" api:"required"`
WorkerBinding StreamNewResponseWorkerBinding `json:"worker_binding" api:"required"`
JSON streamNewResponseJSON `json:"-"`
}
func (*StreamNewResponse) UnmarshalJSON ¶
func (r *StreamNewResponse) UnmarshalJSON(data []byte) (err error)
type StreamNewResponseEnvelope ¶
type StreamNewResponseEnvelope struct {
Errors []StreamNewResponseEnvelopeErrors `json:"errors" api:"required"`
Messages []StreamNewResponseEnvelopeMessages `json:"messages" api:"required"`
Result StreamNewResponse `json:"result" api:"required"`
// Indicates whether the API call was successful.
Success bool `json:"success" api:"required"`
JSON streamNewResponseEnvelopeJSON `json:"-"`
}
func (*StreamNewResponseEnvelope) UnmarshalJSON ¶
func (r *StreamNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type StreamNewResponseEnvelopeErrors ¶
type StreamNewResponseEnvelopeErrors struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`
JSON streamNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*StreamNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *StreamNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type StreamNewResponseEnvelopeMessages ¶
type StreamNewResponseEnvelopeMessages struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`
JSON streamNewResponseEnvelopeMessagesJSON `json:"-"`
}
func (*StreamNewResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *StreamNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type StreamNewResponseHTTP ¶
type StreamNewResponseHTTP struct {
// Indicates whether the HTTP endpoint accepts records.
Enabled bool `json:"enabled" api:"required"`
// Indicates whether the HTTP endpoint requires an API token with K2 produce
// permission. When false, the endpoint accepts unauthenticated records. Defaults
// to true when HTTP is enabled without a stored value.
Authentication bool `json:"authentication"`
CORS StreamNewResponseHTTPCORS `json:"cors"`
JSON streamNewResponseHTTPJSON `json:"-"`
}
Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`, so enabling it again restores them.
func (*StreamNewResponseHTTP) UnmarshalJSON ¶
func (r *StreamNewResponseHTTP) UnmarshalJSON(data []byte) (err error)
type StreamNewResponseHTTPCORS ¶
type StreamNewResponseHTTPCORS struct {
// Allows browser requests from these HTTP or HTTPS origins. Use a wildcard only as
// the sole origin. An empty list blocks cross-origin browser requests. Defaults to
// `['*']` when HTTP is enabled without stored origins.
Origins []string `json:"origins"`
JSON streamNewResponseHttpcorsJSON `json:"-"`
}
func (*StreamNewResponseHTTPCORS) UnmarshalJSON ¶
func (r *StreamNewResponseHTTPCORS) UnmarshalJSON(data []byte) (err error)
type StreamNewResponseWorkerBinding ¶
type StreamNewResponseWorkerBinding struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled StreamNewResponseWorkerBindingEnabled `json:"enabled" api:"required"`
JSON streamNewResponseWorkerBindingJSON `json:"-"`
// contains filtered or unexported fields
}
func (StreamNewResponseWorkerBinding) AsUnion ¶
func (r StreamNewResponseWorkerBinding) AsUnion() StreamNewResponseWorkerBindingUnion
AsUnion returns a StreamNewResponseWorkerBindingUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are StreamNewResponseWorkerBindingEnabled, StreamNewResponseWorkerBindingEnabled.
func (*StreamNewResponseWorkerBinding) UnmarshalJSON ¶
func (r *StreamNewResponseWorkerBinding) UnmarshalJSON(data []byte) (err error)
type StreamNewResponseWorkerBindingEnabled ¶
type StreamNewResponseWorkerBindingEnabled struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled StreamNewResponseWorkerBindingEnabledEnabled `json:"enabled" api:"required"`
JSON streamNewResponseWorkerBindingEnabledJSON `json:"-"`
}
func (*StreamNewResponseWorkerBindingEnabled) UnmarshalJSON ¶
func (r *StreamNewResponseWorkerBindingEnabled) UnmarshalJSON(data []byte) (err error)
type StreamNewResponseWorkerBindingEnabledEnabled ¶
type StreamNewResponseWorkerBindingEnabledEnabled bool
Indicates whether Workers bindings can produce records to the stream.
const (
StreamNewResponseWorkerBindingEnabledEnabledFalse StreamNewResponseWorkerBindingEnabledEnabled = false
)
func (StreamNewResponseWorkerBindingEnabledEnabled) IsKnown ¶
func (r StreamNewResponseWorkerBindingEnabledEnabled) IsKnown() bool
type StreamNewResponseWorkerBindingUnion ¶
type StreamNewResponseWorkerBindingUnion interface {
// contains filtered or unexported methods
}
Union satisfied by StreamNewResponseWorkerBindingEnabled or StreamNewResponseWorkerBindingEnabled.
type StreamService ¶
type StreamService struct {
Options []option.RequestOption
Subscriptions *StreamSubscriptionService
}
StreamService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStreamService method instead.
func NewStreamService ¶
func NewStreamService(opts ...option.RequestOption) (r *StreamService)
NewStreamService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*StreamService) Delete ¶
func (r *StreamService) Delete(ctx context.Context, streamID string, body StreamDeleteParams, opts ...option.RequestOption) (res *StreamDeleteResponse, err error)
Delete a K2 stream in an account. Deleting a stream that does not exist also succeeds.
func (*StreamService) Get ¶
func (r *StreamService) Get(ctx context.Context, streamID string, query StreamGetParams, opts ...option.RequestOption) (res *StreamGetResponse, err error)
Get K2 stream details.
func (*StreamService) List ¶
func (r *StreamService) List(ctx context.Context, params StreamListParams, opts ...option.RequestOption) (res *pagination.V4PagePaginationArray[StreamListResponse], err error)
List or filter K2 streams in an account.
func (*StreamService) ListAutoPaging ¶
func (r *StreamService) ListAutoPaging(ctx context.Context, params StreamListParams, opts ...option.RequestOption) *pagination.V4PagePaginationArrayAutoPager[StreamListResponse]
List or filter K2 streams in an account.
func (*StreamService) New ¶
func (r *StreamService) New(ctx context.Context, params StreamNewParams, opts ...option.RequestOption) (res *StreamNewResponse, err error)
Create a new K2 stream. HTTP is disabled when `http` is omitted. Enabled HTTP requires authentication and allows all origins unless `authentication` or `cors` say otherwise. At least one input must be enabled.
func (*StreamService) Update ¶
func (r *StreamService) Update(ctx context.Context, streamID string, params StreamUpdateParams, opts ...option.RequestOption) (res *StreamUpdateResponse, err error)
Update a K2 stream. Omitted `http` settings, such as `authentication` and `cors`, keep their current values. Disabling HTTP keeps them, so enabling HTTP again restores them. At least one input must remain enabled.
type StreamSubscriptionListResponse ¶
type StreamSubscriptionListResponse struct {
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
Lag StreamSubscriptionListResponseLag `json:"lag" api:"required"`
ModifiedAt time.Time `json:"modified_at" api:"required" format:"date-time"`
Name string `json:"name" api:"required"`
StartAt StreamSubscriptionListResponseStartAt `json:"start_at" api:"required"`
JSON streamSubscriptionListResponseJSON `json:"-"`
}
func (*StreamSubscriptionListResponse) UnmarshalJSON ¶
func (r *StreamSubscriptionListResponse) UnmarshalJSON(data []byte) (err error)
type StreamSubscriptionListResponseLag ¶
type StreamSubscriptionListResponseLag struct {
// Decimal-string distance from the subscription's committed position to the
// observed exclusive stream tail, in records. Includes in-flight records and may
// include expired records or records acknowledged beyond an earlier gap. Null
// unless status is available.
Records string `json:"records" api:"required,nullable"`
// Unsupported means the subscription or stream topology cannot be measured;
// unavailable means a required observation failed or was inconsistent.
Status StreamSubscriptionListResponseLagStatus `json:"status" api:"required"`
JSON streamSubscriptionListResponseLagJSON `json:"-"`
}
func (*StreamSubscriptionListResponseLag) UnmarshalJSON ¶
func (r *StreamSubscriptionListResponseLag) UnmarshalJSON(data []byte) (err error)
type StreamSubscriptionListResponseLagStatus ¶
type StreamSubscriptionListResponseLagStatus string
Unsupported means the subscription or stream topology cannot be measured; unavailable means a required observation failed or was inconsistent.
const ( StreamSubscriptionListResponseLagStatusAvailable StreamSubscriptionListResponseLagStatus = "available" StreamSubscriptionListResponseLagStatusUnsupported StreamSubscriptionListResponseLagStatus = "unsupported" )
func (StreamSubscriptionListResponseLagStatus) IsKnown ¶
func (r StreamSubscriptionListResponseLagStatus) IsKnown() bool
type StreamSubscriptionListResponseStartAt ¶
type StreamSubscriptionListResponseStartAt struct {
Type StreamSubscriptionListResponseStartAtType `json:"type" api:"required"`
JSON streamSubscriptionListResponseStartAtJSON `json:"-"`
}
func (*StreamSubscriptionListResponseStartAt) UnmarshalJSON ¶
func (r *StreamSubscriptionListResponseStartAt) UnmarshalJSON(data []byte) (err error)
type StreamSubscriptionListResponseStartAtType ¶
type StreamSubscriptionListResponseStartAtType string
const ( StreamSubscriptionListResponseStartAtTypeEarliest StreamSubscriptionListResponseStartAtType = "earliest" StreamSubscriptionListResponseStartAtTypeLatest StreamSubscriptionListResponseStartAtType = "latest" )
func (StreamSubscriptionListResponseStartAtType) IsKnown ¶
func (r StreamSubscriptionListResponseStartAtType) IsKnown() bool
type StreamSubscriptionService ¶
type StreamSubscriptionService struct {
Options []option.RequestOption
}
StreamSubscriptionService contains methods and other services that help with interacting with the cloudflare API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStreamSubscriptionService method instead.
func NewStreamSubscriptionService ¶
func NewStreamSubscriptionService(opts ...option.RequestOption) (r *StreamSubscriptionService)
NewStreamSubscriptionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*StreamSubscriptionService) List ¶
func (r *StreamSubscriptionService) List(ctx context.Context, streamID string, query StreamSubscriptionListParams, opts ...option.RequestOption) (res *pagination.SinglePage[StreamSubscriptionListResponse], err error)
Lists every subscription on one stream, oldest first. Lag uses committed positions, not reserved read positions. A failed tail observation preserves subscription metadata and returns unavailable lag.
func (*StreamSubscriptionService) ListAutoPaging ¶
func (r *StreamSubscriptionService) ListAutoPaging(ctx context.Context, streamID string, query StreamSubscriptionListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[StreamSubscriptionListResponse]
Lists every subscription on one stream, oldest first. Lag uses committed positions, not reserved read positions. A failed tail observation preserves subscription metadata and returns unavailable lag.
type StreamUpdateParams ¶
type StreamUpdateParams struct {
// Specifies the public ID of the account.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`,
// so enabling it again restores them.
HTTP param.Field[StreamUpdateParamsHTTP] `json:"http"`
// Sets the record retention period from 1 hour (3600 seconds) to 30 days (2592000
// seconds), inclusive.
RetentionSeconds param.Field[int64] `json:"retention_seconds"`
WorkerBinding param.Field[StreamUpdateParamsWorkerBindingUnion] `json:"worker_binding"`
}
func (StreamUpdateParams) MarshalJSON ¶
func (r StreamUpdateParams) MarshalJSON() (data []byte, err error)
type StreamUpdateParamsHTTP ¶
type StreamUpdateParamsHTTP struct {
// Indicates whether the HTTP endpoint accepts records.
Enabled param.Field[bool] `json:"enabled" api:"required"`
// Indicates whether the HTTP endpoint requires an API token with K2 produce
// permission. When false, the endpoint accepts unauthenticated records. Defaults
// to true when HTTP is enabled without a stored value.
Authentication param.Field[bool] `json:"authentication"`
CORS param.Field[StreamUpdateParamsHTTPCORS] `json:"cors"`
}
Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`, so enabling it again restores them.
func (StreamUpdateParamsHTTP) MarshalJSON ¶
func (r StreamUpdateParamsHTTP) MarshalJSON() (data []byte, err error)
type StreamUpdateParamsHTTPCORS ¶
type StreamUpdateParamsHTTPCORS struct {
// Allows browser requests from these HTTP or HTTPS origins. Use a wildcard only as
// the sole origin. An empty list blocks cross-origin browser requests. Defaults to
// `['*']` when HTTP is enabled without stored origins.
Origins param.Field[[]string] `json:"origins"`
}
func (StreamUpdateParamsHTTPCORS) MarshalJSON ¶
func (r StreamUpdateParamsHTTPCORS) MarshalJSON() (data []byte, err error)
type StreamUpdateParamsWorkerBinding ¶
type StreamUpdateParamsWorkerBinding struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled param.Field[StreamUpdateParamsWorkerBindingEnabled] `json:"enabled" api:"required"`
}
func (StreamUpdateParamsWorkerBinding) MarshalJSON ¶
func (r StreamUpdateParamsWorkerBinding) MarshalJSON() (data []byte, err error)
type StreamUpdateParamsWorkerBindingEnabled ¶
type StreamUpdateParamsWorkerBindingEnabled struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled param.Field[StreamUpdateParamsWorkerBindingEnabledEnabled] `json:"enabled" api:"required"`
}
func (StreamUpdateParamsWorkerBindingEnabled) MarshalJSON ¶
func (r StreamUpdateParamsWorkerBindingEnabled) MarshalJSON() (data []byte, err error)
type StreamUpdateParamsWorkerBindingEnabledEnabled ¶
type StreamUpdateParamsWorkerBindingEnabledEnabled bool
Indicates whether Workers bindings can produce records to the stream.
const (
StreamUpdateParamsWorkerBindingEnabledEnabledFalse StreamUpdateParamsWorkerBindingEnabledEnabled = false
)
func (StreamUpdateParamsWorkerBindingEnabledEnabled) IsKnown ¶
func (r StreamUpdateParamsWorkerBindingEnabledEnabled) IsKnown() bool
type StreamUpdateParamsWorkerBindingUnion ¶
type StreamUpdateParamsWorkerBindingUnion interface {
// contains filtered or unexported methods
}
Satisfied by k2.StreamUpdateParamsWorkerBindingEnabled, k2.StreamUpdateParamsWorkerBindingEnabled, StreamUpdateParamsWorkerBinding.
type StreamUpdateResponse ¶
type StreamUpdateResponse struct {
// Specifies the public ID of the K2 stream.
ID string `json:"id" api:"required"`
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Indicates the base HTTP endpoint for producing and consuming records.
Endpoint string `json:"endpoint" api:"required" format:"uri"`
// Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`,
// so enabling it again restores them.
HTTP StreamUpdateResponseHTTP `json:"http" api:"required"`
ModifiedAt time.Time `json:"modified_at" api:"required" format:"date-time"`
// Indicates the name of the K2 stream.
Name string `json:"name" api:"required"`
// Shows the configured record retention period from 1 hour (3600 seconds) to 30
// days (2592000 seconds), inclusive.
RetentionSeconds int64 `json:"retention_seconds" api:"required"`
WorkerBinding StreamUpdateResponseWorkerBinding `json:"worker_binding" api:"required"`
JSON streamUpdateResponseJSON `json:"-"`
}
func (*StreamUpdateResponse) UnmarshalJSON ¶
func (r *StreamUpdateResponse) UnmarshalJSON(data []byte) (err error)
type StreamUpdateResponseEnvelope ¶
type StreamUpdateResponseEnvelope struct {
Errors []StreamUpdateResponseEnvelopeErrors `json:"errors" api:"required"`
Messages []StreamUpdateResponseEnvelopeMessages `json:"messages" api:"required"`
Result StreamUpdateResponse `json:"result" api:"required"`
// Indicates whether the API call was successful.
Success bool `json:"success" api:"required"`
JSON streamUpdateResponseEnvelopeJSON `json:"-"`
}
func (*StreamUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *StreamUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type StreamUpdateResponseEnvelopeErrors ¶
type StreamUpdateResponseEnvelopeErrors struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`
JSON streamUpdateResponseEnvelopeErrorsJSON `json:"-"`
}
func (*StreamUpdateResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *StreamUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type StreamUpdateResponseEnvelopeMessages ¶
type StreamUpdateResponseEnvelopeMessages struct {
Message string `json:"message" api:"required"`
Code int64 `json:"code"`
JSON streamUpdateResponseEnvelopeMessagesJSON `json:"-"`
}
func (*StreamUpdateResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *StreamUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type StreamUpdateResponseHTTP ¶
type StreamUpdateResponseHTTP struct {
// Indicates whether the HTTP endpoint accepts records.
Enabled bool `json:"enabled" api:"required"`
// Indicates whether the HTTP endpoint requires an API token with K2 produce
// permission. When false, the endpoint accepts unauthenticated records. Defaults
// to true when HTTP is enabled without a stored value.
Authentication bool `json:"authentication"`
CORS StreamUpdateResponseHTTPCORS `json:"cors"`
JSON streamUpdateResponseHTTPJSON `json:"-"`
}
Configures the HTTP endpoint. Disabling HTTP keeps `authentication` and `cors`, so enabling it again restores them.
func (*StreamUpdateResponseHTTP) UnmarshalJSON ¶
func (r *StreamUpdateResponseHTTP) UnmarshalJSON(data []byte) (err error)
type StreamUpdateResponseHTTPCORS ¶
type StreamUpdateResponseHTTPCORS struct {
// Allows browser requests from these HTTP or HTTPS origins. Use a wildcard only as
// the sole origin. An empty list blocks cross-origin browser requests. Defaults to
// `['*']` when HTTP is enabled without stored origins.
Origins []string `json:"origins"`
JSON streamUpdateResponseHttpcorsJSON `json:"-"`
}
func (*StreamUpdateResponseHTTPCORS) UnmarshalJSON ¶
func (r *StreamUpdateResponseHTTPCORS) UnmarshalJSON(data []byte) (err error)
type StreamUpdateResponseWorkerBinding ¶
type StreamUpdateResponseWorkerBinding struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled StreamUpdateResponseWorkerBindingEnabled `json:"enabled" api:"required"`
JSON streamUpdateResponseWorkerBindingJSON `json:"-"`
// contains filtered or unexported fields
}
func (StreamUpdateResponseWorkerBinding) AsUnion ¶
func (r StreamUpdateResponseWorkerBinding) AsUnion() StreamUpdateResponseWorkerBindingUnion
AsUnion returns a StreamUpdateResponseWorkerBindingUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are StreamUpdateResponseWorkerBindingEnabled, StreamUpdateResponseWorkerBindingEnabled.
func (*StreamUpdateResponseWorkerBinding) UnmarshalJSON ¶
func (r *StreamUpdateResponseWorkerBinding) UnmarshalJSON(data []byte) (err error)
type StreamUpdateResponseWorkerBindingEnabled ¶
type StreamUpdateResponseWorkerBindingEnabled struct {
// Indicates whether Workers bindings can produce records to the stream.
Enabled StreamUpdateResponseWorkerBindingEnabledEnabled `json:"enabled" api:"required"`
JSON streamUpdateResponseWorkerBindingEnabledJSON `json:"-"`
}
func (*StreamUpdateResponseWorkerBindingEnabled) UnmarshalJSON ¶
func (r *StreamUpdateResponseWorkerBindingEnabled) UnmarshalJSON(data []byte) (err error)
type StreamUpdateResponseWorkerBindingEnabledEnabled ¶
type StreamUpdateResponseWorkerBindingEnabledEnabled bool
Indicates whether Workers bindings can produce records to the stream.
const (
StreamUpdateResponseWorkerBindingEnabledEnabledFalse StreamUpdateResponseWorkerBindingEnabledEnabled = false
)
func (StreamUpdateResponseWorkerBindingEnabledEnabled) IsKnown ¶
func (r StreamUpdateResponseWorkerBindingEnabledEnabled) IsKnown() bool
type StreamUpdateResponseWorkerBindingUnion ¶
type StreamUpdateResponseWorkerBindingUnion interface {
// contains filtered or unexported methods
}
Union satisfied by StreamUpdateResponseWorkerBindingEnabled or StreamUpdateResponseWorkerBindingEnabled.
type SubscriptionFrequency ¶
type SubscriptionFrequency = shared.SubscriptionFrequency
How often the subscription is renewed automatically.
This is an alias to an internal type.
type SubscriptionParam ¶
type SubscriptionParam = shared.SubscriptionParam
This is an alias to an internal type.
type SubscriptionState ¶
type SubscriptionState = shared.SubscriptionState
The state that the subscription is in.
This is an alias to an internal type.
type TokenCondition ¶
type TokenCondition = shared.TokenCondition
This is an alias to an internal type.
type TokenConditionCIDRList ¶
type TokenConditionCIDRList = shared.TokenConditionCIDRList
IPv4/IPv6 CIDR.
This is an alias to an internal type.
type TokenConditionCIDRListParam ¶
type TokenConditionCIDRListParam = shared.TokenConditionCIDRListParam
IPv4/IPv6 CIDR.
This is an alias to an internal type.
type TokenConditionParam ¶
type TokenConditionParam = shared.TokenConditionParam
This is an alias to an internal type.
type TokenConditionRequestIP ¶
type TokenConditionRequestIP = shared.TokenConditionRequestIP
Client IP restrictions.
This is an alias to an internal type.
type TokenConditionRequestIPParam ¶
type TokenConditionRequestIPParam = shared.TokenConditionRequestIPParam
Client IP restrictions.
This is an alias to an internal type.
type TokenPolicyEffect ¶
type TokenPolicyEffect = shared.TokenPolicyEffect
Allow or deny operations against the resources.
This is an alias to an internal type.
type TokenPolicyParam ¶
type TokenPolicyParam = shared.TokenPolicyParam
This is an alias to an internal type.
type TokenPolicyPermissionGroup ¶
type TokenPolicyPermissionGroup = shared.TokenPolicyPermissionGroup
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type TokenPolicyPermissionGroupParam ¶
type TokenPolicyPermissionGroupParam = shared.TokenPolicyPermissionGroupParam
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type TokenPolicyPermissionGroupsMeta ¶
type TokenPolicyPermissionGroupsMeta = shared.TokenPolicyPermissionGroupsMeta
Attributes associated to the permission group.
This is an alias to an internal type.
type TokenPolicyPermissionGroupsMetaParam ¶
type TokenPolicyPermissionGroupsMetaParam = shared.TokenPolicyPermissionGroupsMetaParam
Attributes associated to the permission group.
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectNested ¶
type TokenPolicyResourcesIAMResourcesTypeObjectNested = shared.TokenPolicyResourcesIAMResourcesTypeObjectNested
Map of nested resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam ¶
type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam = shared.TokenPolicyResourcesIAMResourcesTypeObjectNestedParam
Map of nested resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectString ¶
type TokenPolicyResourcesIAMResourcesTypeObjectString = shared.TokenPolicyResourcesIAMResourcesTypeObjectString
Map of simple string resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectStringParam ¶
type TokenPolicyResourcesIAMResourcesTypeObjectStringParam = shared.TokenPolicyResourcesIAMResourcesTypeObjectStringParam
Map of simple string resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesUnion ¶
type TokenPolicyResourcesUnion = shared.TokenPolicyResourcesUnion
A list of resource names that the policy applies to.
This is an alias to an internal type.
type TokenPolicyResourcesUnionParam ¶
type TokenPolicyResourcesUnionParam = shared.TokenPolicyResourcesUnionParam
A list of resource names that the policy applies to.
This is an alias to an internal type.
type TokenStatus ¶
type TokenStatus = shared.TokenStatus
Status of the token.
This is an alias to an internal type.
type TokenValue ¶
type TokenValue = shared.TokenValue
The token value.
This is an alias to an internal type.