svix

package
v0.45.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int32

func Int32(i int32) *int32

func String

func String(s string) *string

Types

type Application

type Application struct {
	// contains filtered or unexported fields
}

func (*Application) Create

func (a *Application) Create(applicationIn *ApplicationIn) (*ApplicationOut, error)

func (*Application) Delete

func (a *Application) Delete(appId string) error

func (*Application) Get

func (a *Application) Get(appId string) (*ApplicationOut, error)

func (*Application) List

func (*Application) Update

func (a *Application) Update(appId string, applicationIn *ApplicationIn) (*ApplicationOut, error)

type ApplicationIn

type ApplicationIn openapi.ApplicationIn

type ApplicationListOptions added in v0.26.0

type ApplicationListOptions struct {
	Iterator *string
	Limit    *int32
}

type ApplicationOut

type ApplicationOut openapi.ApplicationOut

type Authentication

type Authentication struct {
	// contains filtered or unexported fields
}

func (*Authentication) DashboardAccess

func (a *Authentication) DashboardAccess(appId string) (*DashboardAccessOut, error)

func (*Authentication) Logout

func (a *Authentication) Logout() error

type DashboardAccessOut

type DashboardAccessOut openapi.DashboardAccessOut

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

func (*Endpoint) Create

func (e *Endpoint) Create(appId string, endpointIn *EndpointIn) (*EndpointOut, error)

func (*Endpoint) Delete

func (e *Endpoint) Delete(appId string, endpointId string) error

func (*Endpoint) Get

func (e *Endpoint) Get(appId string, endpointId string) (*EndpointOut, error)

func (*Endpoint) GetHeaders added in v0.37.0

func (e *Endpoint) GetHeaders(appId string, endpointId string) (*EndpointHeadersOut, error)

func (*Endpoint) GetSecret

func (e *Endpoint) GetSecret(appId string, endpointId string) (*EndpointSecretOut, error)

func (*Endpoint) List

func (e *Endpoint) List(appId string, options *EndpointListOptions) (*ListResponseEndpointOut, error)

func (*Endpoint) PatchHeaders added in v0.37.0

func (e *Endpoint) PatchHeaders(appId string, endpointId string, endpointHeadersIn *EndpointHeadersIn) error

func (*Endpoint) Recover added in v0.36.0

func (e *Endpoint) Recover(appId string, endpointId string, recoverIn *RecoverIn) error

func (*Endpoint) RotateSecret added in v0.34.0

func (e *Endpoint) RotateSecret(appId string, endpointId string, endpointSecretRotateIn *EndpointSecretRotateIn) error

func (*Endpoint) Update

func (e *Endpoint) Update(appId string, endpointId string, endpointUpdate *EndpointUpdate) (*EndpointOut, error)

func (*Endpoint) UpdateHeaders added in v0.37.0

func (e *Endpoint) UpdateHeaders(appId string, endpointId string, endpointHeadersIn *EndpointHeadersIn) error

type EndpointHeadersIn added in v0.37.0

type EndpointHeadersIn openapi.EndpointHeadersIn

type EndpointHeadersOut added in v0.37.0

type EndpointHeadersOut openapi.EndpointHeadersOut

type EndpointIn

type EndpointIn openapi.EndpointIn

type EndpointListOptions added in v0.26.0

type EndpointListOptions struct {
	Iterator *string
	Limit    *int32
}

type EndpointOut

type EndpointOut openapi.EndpointOut

type EndpointSecretOut

type EndpointSecretOut openapi.EndpointSecretOut

type EndpointSecretRotateIn added in v0.34.0

type EndpointSecretRotateIn openapi.EndpointSecretRotateIn

type EndpointUpdate added in v0.29.0

type EndpointUpdate openapi.EndpointUpdate

type Error added in v0.18.0

type Error struct {
	// contains filtered or unexported fields
}

Error provides access to the body, status, and error on returned errors.

func (Error) Body added in v0.18.0

func (e Error) Body() []byte

Body returns the raw bytes of the response.

func (Error) Error added in v0.18.0

func (e Error) Error() string

Error returns non-empty string if there was an error.

func (Error) Status added in v0.18.0

func (e Error) Status() int

Status returns the HTTP status of the error.

type EventType

type EventType struct {
	// contains filtered or unexported fields
}

func (*EventType) Create

func (e *EventType) Create(eventTypeIn *EventTypeIn) (*EventTypeOut, error)

func (*EventType) Delete

func (e *EventType) Delete(eventTypeName string) error

func (*EventType) Get added in v0.38.0

func (e *EventType) Get(eventTypeName string) (*EventTypeOut, error)

func (*EventType) List

func (*EventType) Update

func (e *EventType) Update(eventTypeName string, eventTypeUpdate *EventTypeUpdate) (*EventTypeOut, error)

type EventTypeIn

type EventTypeIn openapi.EventTypeIn

type EventTypeListOptions added in v0.26.0

type EventTypeListOptions struct {
	Iterator        *string
	Limit           *int32
	WithContent     *bool
	IncludeArchived *bool
}

type EventTypeOut

type EventTypeOut openapi.EventTypeOut

type EventTypeUpdate

type EventTypeUpdate openapi.EventTypeUpdate

type Integration added in v0.44.0

type Integration struct {
	// contains filtered or unexported fields
}

func (*Integration) Create added in v0.44.0

func (e *Integration) Create(appId string, endpointIn *IntegrationIn) (*IntegrationOut, error)

func (*Integration) Delete added in v0.44.0

func (e *Integration) Delete(appId string, integId string) error

func (*Integration) Get added in v0.44.0

func (e *Integration) Get(appId string, integId string) (*IntegrationOut, error)

func (*Integration) GetKey added in v0.44.0

func (e *Integration) GetKey(appId string, integId string) (*IntegrationKeyOut, error)

func (*Integration) List added in v0.44.0

func (*Integration) RotateKey added in v0.44.0

func (e *Integration) RotateKey(appId string, integId string) (*IntegrationKeyOut, error)

func (*Integration) Update added in v0.44.0

func (e *Integration) Update(appId string, integId string, endpointUpdate *IntegrationUpdate) (*IntegrationOut, error)

type IntegrationIn added in v0.44.0

type IntegrationIn openapi.IntegrationIn

type IntegrationKeyOut added in v0.44.0

type IntegrationKeyOut openapi.IntegrationKeyOut

type IntegrationListOptions added in v0.44.0

type IntegrationListOptions struct {
	Iterator *string
	Limit    *int32
}

type IntegrationOut added in v0.44.0

type IntegrationOut openapi.IntegrationOut

type IntegrationUpdate added in v0.44.0

type IntegrationUpdate openapi.IntegrationUpdate

type ListResponseApplicationOut

type ListResponseApplicationOut openapi.ListResponseApplicationOut

type ListResponseEndpointMessageOut

type ListResponseEndpointMessageOut openapi.ListResponseEndpointMessageOut

type ListResponseEndpointOut

type ListResponseEndpointOut openapi.ListResponseEndpointOut

type ListResponseEventTypeOut

type ListResponseEventTypeOut openapi.ListResponseEventTypeOut

type ListResponseIntegrationOut added in v0.44.0

type ListResponseIntegrationOut openapi.ListResponseIntegrationOut

type ListResponseMessageAttemptOut

type ListResponseMessageAttemptOut openapi.ListResponseMessageAttemptOut

type ListResponseMessageEndpointOut

type ListResponseMessageEndpointOut openapi.ListResponseMessageEndpointOut

type ListResponseMessageOut

type ListResponseMessageOut openapi.ListResponseMessageOut

type Message

type Message struct {
	// contains filtered or unexported fields
}

func (*Message) Create

func (m *Message) Create(appId string, messageIn *MessageIn) (*MessageOut, error)

func (*Message) Get

func (m *Message) Get(appId string, msgId string) (*MessageOut, error)

func (*Message) List

func (m *Message) List(appId string, options *MessageListOptions) (*ListResponseMessageOut, error)

type MessageAttempt

type MessageAttempt struct {
	// contains filtered or unexported fields
}

func (*MessageAttempt) Get

func (m *MessageAttempt) Get(appId string, msgId string, attemptID string) (*MessageAttemptOut, error)

func (*MessageAttempt) List

func (*MessageAttempt) ListAttemptedDestinations

func (m *MessageAttempt) ListAttemptedDestinations(appId string, msgId string, options *MessageAttemptListOptions) (*ListResponseMessageEndpointOut, error)

func (*MessageAttempt) ListAttemptedMessages

func (m *MessageAttempt) ListAttemptedMessages(appId string, endpointId string, options *MessageAttemptListOptions) (*ListResponseEndpointMessageOut, error)

func (*MessageAttempt) ListAttemptsForEndpoint

func (m *MessageAttempt) ListAttemptsForEndpoint(appId string, msgId string, endpointId string, options *MessageAttemptListOptions) (*ListResponseMessageAttemptEndpointOut, error)

func (*MessageAttempt) Resend

func (m *MessageAttempt) Resend(appId string, msgId string, endpointId string) error

type MessageAttemptListOptions added in v0.26.0

type MessageAttemptListOptions struct {
	Iterator   *string
	Limit      *int32
	Status     *MessageStatus
	EventTypes *[]string
	Before     *time.Time
}

type MessageAttemptOut

type MessageAttemptOut openapi.MessageAttemptOut

type MessageIn

type MessageIn openapi.MessageIn

type MessageListOptions added in v0.26.0

type MessageListOptions struct {
	Iterator   *string
	Limit      *int32
	EventTypes *[]string
	Before     *time.Time
}

type MessageOut

type MessageOut openapi.MessageOut

type MessageStatus

type MessageStatus openapi.MessageStatus

type RecoverIn added in v0.36.0

type RecoverIn openapi.RecoverIn

type Svix

type Svix struct {
	Authentication *Authentication
	Application    *Application
	Endpoint       *Endpoint
	EventType      *EventType
	Integration    *Integration
	Message        *Message
	MessageAttempt *MessageAttempt
}

func New

func New(token string, options *SvixOptions) *Svix

type SvixOptions

type SvixOptions struct {
	Debug bool

	// Overrides the base URL (protocol + hostname) used for all requests sent by this Svix client. (Useful for testing)
	ServerUrl  *url.URL
	HTTPClient *http.Client
}

type Webhook

type Webhook struct {
	// contains filtered or unexported fields
}

func NewWebhook

func NewWebhook(secret string) (*Webhook, error)

func (*Webhook) Sign added in v0.21.0

func (wh *Webhook) Sign(msgId string, timestamp time.Time, payload []byte) (string, error)

func (*Webhook) Verify

func (wh *Webhook) Verify(payload []byte, headers http.Header) error

Verify validates the payload against the svix signature headers using the webhooks signing secret.

Returns an error if the body or headers are missing/unreadable or if the signature doesn't match.

func (*Webhook) VerifyIgnoringTimestamp added in v0.39.0

func (wh *Webhook) VerifyIgnoringTimestamp(payload []byte, headers http.Header) error

VerifyIgnoringTimestamp validates the payload against the svix signature headers using the webhooks signing secret.

Returns an error if the body or headers are missing/unreadable or if the signature doesn't match.

WARNING: This function does not check the signature's timestamp. We recommend using the `Verify` function instead.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL