mirror of
https://github.com/go-micro/go-micro.git
synced 2025-08-10 21:52:01 +02:00
Docs (#2779)
* add docs layout * update all to use _layouts * update the styling
This commit is contained in:
34
internal/website/_layouts/default.html
Normal file
34
internal/website/_layouts/default.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% if page.title %}{{ page.title }} | {% endif %}Go Micro Documentation</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; margin: 0; padding: 0; background: #f9f9f9; }
|
||||
header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 2rem; background: #fff; border-bottom: 1px solid #eee; }
|
||||
.logo-link { display: flex; align-items: center; text-decoration: none; }
|
||||
.logo-link img { height: 40px; margin-right: 10px; }
|
||||
nav a { margin-left: 24px; color: #333; text-decoration: none; font-weight: 500; }
|
||||
nav a:hover { color: #007d9c; }
|
||||
main { max-width: 800px; margin: 2rem auto; background: #fff; padding: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
|
||||
pre { background: whitesmoke; padding: 10px; border-radius: 5px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<a class="logo-link" href="/">
|
||||
<img src="/images/logo.png" alt="Go Micro Logo">
|
||||
<span style="font-size: 1.3rem; font-weight: bold; color: #222;">Go Micro</span>
|
||||
</a>
|
||||
<nav>
|
||||
<a href="/docs/">Docs</a>
|
||||
<a href="https://github.com/micro/go-micro" target="_blank" rel="noopener">GitHub</a>
|
||||
<a href="/">Home</a>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
{{ content }}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
@@ -1,26 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
## Example Usage
|
||||
|
||||
Here's a minimal Go Micro service demonstrating the architecture:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"go-micro.dev/v5"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("example"),
|
||||
)
|
||||
service.Init()
|
||||
if err := service.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
## Architecture
|
||||
|
||||
An overview of the Go Micro architecture
|
||||
@@ -63,3 +44,26 @@ in the plugins repo. State and persistence becomes a core requirement beyond pro
|
||||
## Design
|
||||
|
||||
We will share more on architecture soon
|
||||
|
||||
## Example Usage
|
||||
|
||||
Here's a minimal Go Micro service demonstrating the architecture:
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"go-micro.dev/v5"
|
||||
"log"
|
||||
)
|
||||
|
||||
func main() {
|
||||
service := micro.NewService(
|
||||
micro.Name("example"),
|
||||
)
|
||||
service.Init()
|
||||
if err := service.Run(); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Broker
|
||||
|
||||
The broker provides pub/sub messaging for Go Micro services.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Client/Server
|
||||
|
||||
Go Micro uses a client/server model for RPC communication between services.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Getting Started
|
||||
|
||||
To make use of Go Micro
|
||||
@@ -117,15 +121,15 @@ package greeter;
|
||||
option go_package = "/proto;helloworld";
|
||||
|
||||
service Say {
|
||||
rpc Hello(Request) returns (Response) {}
|
||||
rpc Hello(Request) returns (Response) {}
|
||||
}
|
||||
|
||||
message Request {
|
||||
string name = 1;
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message Response {
|
||||
string message = 1;
|
||||
string message = 1;
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Docs
|
||||
|
||||
Documentation for the Go Micro framework
|
@@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Registry
|
||||
|
||||
The registry is responsible for service discovery in Go Micro. It allows services to register themselves and discover other services.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Store
|
||||
|
||||
The store provides a pluggable interface for data storage in Go Micro.
|
||||
|
@@ -1,3 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Transport
|
||||
|
||||
The transport layer is responsible for communication between services.
|
||||
|
BIN
internal/website/images/logo.png
Normal file
BIN
internal/website/images/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
Reference in New Issue
Block a user