https://github.com/asjard/asjard
Asjard is a protobuf-driven microservice framework implemented in Go that provides a unified platform for building scalable distributed services. Orchestrates multiple protocols (REST, gRPC, message queues), dynamic configuration management, code generation pipelines, and comprehensive observability features through a single configuration-driven in
https://github.com/asjard/asjard
asjard code-generation dynamic-configuration golang microservice multi-protocol-support protobuf server
Last synced: about 1 month ago
JSON representation
Asjard is a protobuf-driven microservice framework implemented in Go that provides a unified platform for building scalable distributed services. Orchestrates multiple protocols (REST, gRPC, message queues), dynamic configuration management, code generation pipelines, and comprehensive observability features through a single configuration-driven in
- Host: GitHub
- URL: https://github.com/asjard/asjard
- Owner: asjard
- License: mit
- Created: 2024-04-17T11:41:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-02-03T05:25:32.000Z (about 2 months ago)
- Last Synced: 2026-02-03T18:42:08.448Z (about 2 months ago)
- Topics: asjard, code-generation, dynamic-configuration, golang, microservice, multi-protocol-support, protobuf, server
- Language: Go
- Homepage: https://asjard.gitbook.io/
- Size: 12.3 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://godoc.org/github.com/asjard/asjard)
[](https://github.com/asjard/asjard/actions/workflows/go.yml)
[](https://goreportcard.com/report/github.com/asjard/asjard)
[](https://github.com/asjard/asjard/blob/main/go.mod)
[](https://deepwiki.com/asjard/asjard)
## Asjard
Asjard is a protobuf-driven microservice framework implemented in Go that provides a unified platform for building scalable distributed services. Orchestrates multiple protocols (REST, gRPC, message queues), dynamic configuration management, code generation pipelines, and comprehensive observability features through a single configuration-driven interface.
## Features
- Code Generation
- Dynamic Configuration
- Data Stores
- Error Management
- OpenAPI Document
## Quick Start
### Install
```bash
go get -u github.com/asjard/asjard
```
### Running in asjard
- define protobuf
```proto
syntax = "proto3";
package api.v1.example.docs;
// The target Go package path for generated code.
option go_package = "protos-repo/example/api/v1/sample";
import "github.com/asjard/protobuf/http.proto";
import "github.com/asjard/protobuf/validate.proto";
// Sample service provides basic greeting operations.
service Sample {
// SayHello returns a greeting message based on the provided name.
// It supports multiple HTTP GET entrypoints for compatibility and routing flexibility.
rpc SayHello(HelloRequest) returns (HelloReply) {
// Dynamic path mapping (e.g., /helloworld/john)
option (asjard.api.http) = {
get : "/helloworld/{name}"
};
// Static path mapping for general greetings
option (asjard.api.http) = {
get : '/hello'
};
}
}
// HelloRequest defines the input payload for the SayHello method.
message HelloRequest {
// The name of the person to greet.
// Validation: Must be provided (required) and no longer than 20 characters.
string name = 1 [ (asjard.api.validate).rules = "required,max=20" ];
}
// HelloReply defines the output payload containing the greeting result.
message HelloReply {
// The formatted greeting string (e.g., "Hello, name!").
string message = 1;
}
```
- implement in go
```go
package main
import (
"context"
"log"
pb "protos-repo/example/api/v1/sample"
"github.com/asjard/asjard"
"github.com/asjard/asjard/pkg/server/grpc"
"github.com/asjard/asjard/pkg/server/rest"
)
type SampleAPI struct {
pb.UnimplementedSampleServer
}
func NewSampleAPI() *SampleAPI {
return &SampleAPI{}
}
func (api *SampleAPI) Start() error { return nil }
func (api *SampleAPI) Stop() {}
// GRPC server
func (api *SampleAPI) GrpcServiceDesc() *grpc.ServiceDesc { return &pb.Sample_ServiceDesc }
// HTTP server
func (api *SampleAPI) RestServiceDesc() *rest.ServiceDesc { return &pb.SampleRestServiceDesc }
func (api *SampleAPI) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) {
return &pb.HelloReply{
Message: "hello " + in.Name,
}, nil
}
func main() {
server := asjard.New()
if err := server.AddHandler(SampleAPI{}, rest.Protocol, grpc.Protocol); err != nil {
log.Fatal(err)
}
log.Fatal(server.Start())
}
```
### See more examples and documents
- Reference [Document](https://asjard.gitbook.io/docs)
- Examples [asjard-example](https://github.com/asjard/asjard/tree/develop/_examples)
- Study in [](https://deepwiki.com/asjard/asjard)
## Benchmark
- Latency


- Concurrency


- Allocations


More information see [TestCode](https://github.com/asjard/benchmark)
## ThirdParty
Here are some open source libraries used in this framework
| Repo | Description |
| ------------------------------------------------------------------- | --------------------------- |
| [fasthttp](https://github.com/valyala/fasthttp) | http protocol |
| [fasthttp-router](https://github.com/fasthttp/router) | http route management |
| [grpc](https://google.golang.org/grpc) | grpc protocol |
| [protobuf](https://google.golang.org/protobuf) | protobuf protocol |
| [hystrix-go](https://github.com/afex/hystrix-go) | circuit breaker |
| [fsnotify](https://github.com/fsnotify/fsnotify) | configration file listen |
| [prometheus-client-go](https://github.com/prometheus/client_golang) | prometheus |
| [etcd](https://go.etcd.io/etcd/client/v3) | etcd client |
| [gorm](https://gorm.io/gorm) | database client |
| [redis](https://github.com/redis/go-redis/v9) | redis client |
| [yaml-v2](https://gopkg.in/yaml.v2) | yaml parser |
| [fressache](https://github.com/coocood/freecache) | local cache |
| [gnostic](https://github.com/google/gnostic) | openapiv3 document generate |
| [cast](https://github.com/spf13/cast) | type convert |
| [lumberjack](gopkg.in/natefinch/lumberjack.v2) | log |
| [asynq](github.com/hibiken/asynq) | asynq |
| [rabbitmq](github.com/streadway/amqp) | rabbitmq |
## License
[MIT](https://github.com/asjard/asjard?tab=MIT-1-ov-file)