platform

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MPL-2.0 Imports: 4 Imported by: 0

README

Encore Platform SDK

Package platform is the SDK for communicating with Encore hosted services The Encore Platform SDK provides APIs for Encore applications to use at runtime to communicate with Encore hosted services. It is used by the Encore Runtime as a provide SDK for communicating with the Encore Platform, the same way the Encore Runtime uses the AWS or GCP SDKs under the hood.

It is not intended to be used by applications directly, and therefore it's API is not considered to be stable.

Documentation

Overview

Package platform is the SDK for communicating with Encore hosted services

The Encore Platform SDK provides APIs for Encore applications to use at runtime to communicate with Encore hosted services. It is used by the Encore Runtime as a provide SDK for communicating with the Encore Platform, the same way the Encore Runtime uses the AWS or GCP SDKs under the hood.

It is not intended to be used by applications directly, and therefore it's API is not considered to be stable.

Overview of Packages

  • platform - The main SDK package, contains shared types used
  • encorecloud - The SDK for communicating with the Encore Cloud specific services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(config *client.Config)

Option is a function that can be passed to New to configure the SDK.

func WithAppDetails

func WithAppDetails(appSlug, envName string) Option

WithAppDetails configures the SDK to act on behalf of the specified application and environment.

func WithAuthKeys

func WithAuthKeys(keys ...auth.Key) Option

WithAuthKeys configures the SDK to use the specified auth keys.

func WithClock

func WithClock(clock clock.Clock) Option

WithClock configures the SDK to use the specified clock.

This is useful for testing with a mocked clock, if not specified a real clock will be used.

func WithHost

func WithHost(host string) Option

WithHost configures the SDK to use the specified host, overriding the default.

type SDK

type SDK struct {
	// EncoreCloud is the client for services hosted specifically
	// to support applications deployed within the Encore Cloud.
	EncoreCloud *encorecloud.Client
}

SDK is the main SDK for communicating with the Encore Platform services.

func NewSDK

func NewSDK(options ...Option) *SDK

NewSDK creates a new SDK with the specified options.

Directories

Path Synopsis
Package encorecloud contains the abstractions for interacting with Encore Cloud specific services
Package encorecloud contains the abstractions for interacting with Encore Cloud specific services
internal
client
Package client provides a generic client for communicating with Encore Platform API services, both pushing data to them, but also for verifying the authenticity of data pushed to the running app from those services.
Package client provides a generic client for communicating with Encore Platform API services, both pushing data to them, but also for verifying the authenticity of data pushed to the running app from those services.
jsonerr
Package jsonerr provides a simple way to return structured error information to the client using JSON encoding.
Package jsonerr provides a simple way to return structured error information to the client using JSON encoding.
pkg
auth
Package auth provides a way for Encore applications to authenticate against Encore Platform services.
Package auth provides a way for Encore applications to authenticate against Encore Platform services.

Jump to

Keyboard shortcuts

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