echonext-integrations
/echonext-integrations
Dodaje do aplikacji EchoNext endpointy WebSocket, schemat GraphQL z gqlgen oraz przyjmowanie plików multipart z walidacją.
- Autor
- abdussamadbello ↗
- Repozytorium
- echonext ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 26.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 4
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Dodaje do aplikacji EchoNext endpointy WebSocket, schemat GraphQL z gqlgen oraz przyjmowanie plików multipart z walidacją.
Oryginalny opis (EN)
Add WebSocket, GraphQL, or file-upload endpoints to an EchoNext app. Use when building real-time/WebSocket handlers (Hub pattern), wiring a gqlgen GraphQL schema, or accepting multipart file uploads with validation.
Jak działa
- WebSocket — app.WS(...)
- GraphQL — app.GraphQL(...)
- File upload — app.Upload(...)
- Choosing
Podgląd SKILL.md
---
name: echonext-integrations
description: >-
Add WebSocket, GraphQL, or file-upload endpoints to an EchoNext app. Use when
building real-time/WebSocket handlers (Hub pattern), wiring a gqlgen GraphQL
schema, or accepting multipart file uploads with validation.
license: MIT
metadata:
version: 0.1.0
---
# EchoNext Integrations
Beyond standard JSON handlers, EchoNext ships first-class support for three
integration types, each with its own package and route method. Scaffold any of
them with `echonext generate websocket|graphql|upload` (see `echonext-cli`),
then fill in the logic using the references below.
## WebSocket — `app.WS(...)`
Implement the `websocket.Handler` interface (connect/message/disconnect
lifecycle) and register it. A `Hub` tracks connections and broadcasts.
```go
app.WS("/ws/chat", chatHandler, echonext.Route{
Summary: "Chat WebSocket",
Tags: []string{"Chat"},
})
```
The interface (note `OnMessage` takes a `messageType int`):
```go
type Handler interface {
OnConnect(conn *websocket.Connection) error
OnMessage(conn *websocket.Connection, messageType int, data []byte) error
OnDisconnect(conn *websocket.Connection, err error)
}
```
Full Hub/Connection API and a chat example:
[`references/websocket.md`](references/websocket.md).
## GraphQL — `app.GraphQL(...)`
Pass a gqlgen `ExecutableSchema` via `graphql.Config`; the Echo context is
injected so resolvers can read auth/request data.
```go
app.GraphQL(graphql.Config{
Path: "/graphql",
PlaygroundPath: "/playground",
Schema: generated.NewExecutableSchema(generated.Config{Resolvers: r}),
EnableIntrospection: true,
}, graphql.Route{Summary: "GraphQL API", Tags: []string{"GraphQL"}})
```
Config/Route fields and resolver context access:
[`references/graphql.md`](references/graphql.md).
## File upload — `app.Upload(...)`
Use a request struct with `*upload.File` (or `[]*upload.File`) fields tagged
`form:"..."`; the framework parses multipart, enforces `upload.Config` limits,
and validates.
```go
type AvatarRequest struct {
File *upload.File `form:"file" validate:"required"`
}
app.Upload("/avatar", uploadAvatar, echonext.Route{
Summary: "Upload avatar",
Tags: []string{"Avatar"},
FileConfig: &upload.Config{MaxFileSize: 5 << 20, AllowedExtensions: []string{".png", ".jpg"}},
})
```
`File` methods (`SaveTo`, `Open`, `Read`, `Extension`) and multi-file uploads:
[`references/upload.md`](references/upload.md).
## Choosing
- **WebSocket** — real-time, bidirectional (chat, live updates).
- **GraphQL** — flexible client-driven queries over a typed schema.
- **Upload** — multipart file intake with size/type validation.
All three still register routes on the same `*App` and appear in the generated
OpenAPI spec (upload as multipart; GraphQL/WS documented per their `Route`).
Pliki w paczce (4)
- SKILL.md 3 KB
- references/graphql.md 2 KB
- references/upload.md 3 KB
- references/websocket.md 3 KB
Wersje
W bazie nie ma innych skilli o nazwie echonext-integrations.
Migawka bazy z 13.11.2026 · wersja paczki 63742b5ef86c (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100echonext-handlers
Tworzy i rejestruje typowane handlery HTTP EchoNext wraz ze strukturami żądań, tagami walidacji i trasami GET, POST, PUT, PATCH i DELETE. - 100echonext-testing
Pisze testy API EchoNext z helperami APIClient, Suite i FixtureManager do żądań w procesie, przygotowania środowiska i danych testowych. - 100golang-graphql
Implementuje API GraphQL w Go przy użyciu gqlgen lub graphql-go: projektowanie schematów, resolvery, subskrypcje i integracja z istniejącymi usługami HTTP. - 100go-graphql
Pomaga budować i recenzować API GraphQL w Go: wybór biblioteki (gqlgen lub graph-gophers), projekt schematu, cienkie resolvery, DataLoadery przeciw N+1, uwierzytelnianie, subskrypcje i limity złożoności. - 100go-graphql
Pomaga budować i recenzować API GraphQL w Go: wybór biblioteki (gqlgen lub graph-gophers), projekt schematu, cienkie resolvery, DataLoadery przeciw N+1, uwierzytelnianie, subskrypcje i limity złożoności. - 100go-graphql
Buduje serwery GraphQL w Go z gqlgen: generowanie schema-first, struktura resolverów, problem N+1 i dataloadery, limity złożoności i głębokości, prezentacja błędów, autoryzacja pól i testy resolverów.