Encore is the Backend Development Platform purpose-built to help you create event-driven and distributed systems.
MPL-2.0 License
Bot releases are visible (Hide)
Published by eandre about 3 years ago
Encore now has much improved documentation, and an improved encore run
experience!
encore run
experienceWe added more real-time feedback about what Encore is doing when starting up. This especially helps when starting to use Encore and there's lots of things happening (compiling the Go standard library and all app dependencies, pulling docker images for PostgreSQL, creating the database, etc) that take time. See screenshot below!
Authorization: Token foo
as well as Authorization: Bearer foo
for authenticationENCORE_DAEMON_DEV=1
to make it easier to develop the Encore daemonjson.RawMessage
handling in generated TypeScript client (#73)float64
(#43)int
and uint
handling in the API ExplorerPublished by eandre over 3 years ago
Encore now has support for defining RESTful APIs in an easy, powerful way!
Defining APIs can now include the path=/foo/bar
and method=FOO
parameters to customize the HTTP path and method the API is exposed at:
type CreateOrderParams struct { /* ... */ }
type Order struct { /* ... */ }
//encore:api public path=/orders method=POST
func CreateOrder(ctx context.Context, p *CreateOrderParams) (*Order, error) { /* ... */ }
You can also define custom API path parameters such as path=/orders/:id
.
When you specify a parameter, Encore passes that parameter directly to your function as a separate argument, like so:
type Order struct { /* ... */ }
//encore:api public path=/orders/:id method=GET
func GetOrder(ctx context.Context, id int) (*Order, error) { /* ... */ }
Encore automatically performs validation of the parameter, according to the type used in the function signature.
In this case id
must be an integer. You can also use string
, bool
, uint8
, and so on. You can even use encore.dev/types/uuid.UUID
if you want to receive UUIDs.
Encore parses all the APIs in your application and ensures they don't conflict. For any given API call there can only ever be zero or one API that matches. If you define paths that conflict, Encore raises a compilation error.
Like always, Encore makes it easy to do API calls between services, and these parameterized APIs work just as easily as before: just call the function: service.GetOrder(ctx, 5)
.
Encore's web platform now provides much-improved secrets management support. You can view, update, and roll back secrets to previous versions.
Published by eandre over 3 years ago
Encore now supports customizing the HTTP path of API raw endpoints. The next release will include complete support for all types of API endpoints.
//encore:api public raw path=/hello/:name
func Greet(w http.ResponseWriter, req *http.Request) {
name := strings.TrimPrefix(req.URL.Path, "/hello/")
fmt.Fprintf(w, "Hello, %s!", name)
}
Published by eandre over 3 years ago
Encore now includes even better Distributed Tracing support out of the box!
Stack traces are incredibly useful for debugging, but common wisdom is that they're too slow to collect at scale.
Encore's deep integration across the stack enabled us to do this in a highly performant way, by only snapshotting
program counters at runtime and mapping it to source code information when the trace is viewed.
This enables Encore to collect stack traces in less than 300ns!
The end result is that Encore now provides complete stack traces for all events, including API calls, database queries, log messages, and so on.
Encore now also includes automatic tracing of outgoing HTTP requests. This also works out of the box, and works for all HTTP calls using Go's standard library net/http
package.
Hope you enjoy the new release!
Published by eandre over 3 years ago
Encore now has great built-in support for API errors. Features include:
All of this is made possible using the encore.dev/beta/errs
package.
Read all about it in the Encore docs!
Published by eandre over 3 years ago
Encore now adds structured log messages to the automatic tracing, using encore.dev/rlog
.
Log messages written during traced requests are automatically added to the trace.
The structure of additional fields is preserved, allowing us to index and filter by structured log context later!
Published by eandre over 3 years ago
This release fixes a few minor issues discovered following the open-source release:
encore db shell
for local developmentauth
endpoint lacks an Authorization
headerencore gen client