Skip to content

Commit 2121308

Browse files
committed
fix: Remove outdated aliases from the document to simplify the content
1 parent 3f9bdf2 commit 2121308

File tree

7 files changed

+16
-29
lines changed

7 files changed

+16
-29
lines changed

content/docs/concepts/architecture-and-repo.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
title: Architecture & Repository Strategy
33
weight: 25
4-
aliases:
5-
- /docs/concepts/microservice-architecture/
6-
- /docs/concepts/code-repository-types/
74
---
85

96
Start monolith-first with clean boundaries, then split when needed. Use a single Go module with Makefile-driven code generation to keep contracts and runtime consistent.

content/docs/concepts/project-structure.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
title: Project Structure
33
weight: 21
4-
aliases:
5-
- /docs/concepts/project-code-structure/
6-
- /docs/concepts/project-layout/
74
---
85

96
Sphere follows a pragmatic project structure that keeps code generation, server code, and business logic cleanly separated while staying fast to iterate on. The structure is based on the [sphere-layout](https://github.com/go-sphere/sphere-layout) template and follows Go community best practices.

content/docs/concepts/protocol-and-codegen.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
title: Protocol & Codegen
33
weight: 23
4-
aliases:
5-
- /docs/concepts/protobuf-protocol/
6-
- /docs/concepts/code-generation-engine/
74
---
85

96
Sphere follows a "protocol-first" approach where you define your APIs once in Protobuf and generate everything else from those definitions. This ensures consistency across your entire stack and reduces boilerplate code.

content/docs/getting-started/_index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: Getting Started
33
weight: 10
4-
aliases:
5-
- /docs/start/
64
---
75

86
Kick off your first Sphere project.

content/docs/getting-started/quickstart.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
---
22
title: Quick Start
33
weight: 11
4-
aliases:
5-
- /docs/start/getting-started/
6-
- /docs/start/getting-started
7-
- /docs/getting-started/quickstart
8-
- /docs/getting-started/introduction
9-
- /docs/getting-started/creating-your-first-project
104
---
115

126
Sphere is a pragmatic Go backend toolkit centered on a clean monolithic template and a small toolchain that automates schema, API contracts, server stubs, Swagger, and even TypeScript clients.

content/docs/getting-started/workflow.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
title: Development Workflow
33
weight: 12
4-
aliases:
5-
- /docs/start/workflow/
6-
- /docs/start/workflow
74
---
85

96
A typical day-to-day development cycle with Sphere follows this pattern:

content/docs/guides/logging.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func main() {
6565
To add structured context to your logs, you can use `log.With` to create a new logger instance with predefined fields.
6666

6767
```go
68-
logger := log.With(log.String("service", "UserService"), log.String("traceId", "xyz-123"))
68+
logger := log.With(log.WithAttrs(map[string]any{"module": "api"}))
6969

7070
logger.Info("User lookup successful")
7171
// Output will include {"service": "UserService", "traceId": "xyz-123", "message": "User lookup successful"}
@@ -104,8 +104,10 @@ Use structured logging in your HTTP handlers to track requests:
104104
```go
105105
func (s *UserService) CreateUser(c *gin.Context) {
106106
logger := log.With(
107-
log.String("handler", "CreateUser"),
108-
log.String("requestId", c.GetHeader("X-Request-ID")),
107+
log.WithAttrs(map[string]any{
108+
"service": "UserService",
109+
"traceId": c.GetString("traceId"), // assuming traceId is set in context
110+
})
109111
)
110112

111113
logger.Info("Creating user request received")
@@ -140,7 +142,12 @@ Add contextual logging to your business logic:
140142

141143
```go
142144
func (b *UserBiz) CreateUser(ctx context.Context, req *CreateUserRequest) (*User, error) {
143-
logger := log.With(log.String("method", "CreateUser"))
145+
logger := log.With(
146+
log.WithAttrs(map[string]any{
147+
"module": "business",
148+
"function": "CreateUser",
149+
}),
150+
)
144151

145152
logger.Debug("Validating user input", log.String("email", req.Email))
146153

@@ -355,12 +362,12 @@ Always include relevant context in your logs:
355362

356363
```go
357364
func (s *Service) ProcessOrder(ctx context.Context, orderID string) error {
358-
logger := log.With(
359-
log.String("orderID", orderID),
360-
log.String("userID", getUserIDFromContext(ctx)),
361-
)
362365

363-
logger.Info("Processing order")
366+
logger.Info("Processing order",
367+
log.String("orderId", orderID),
368+
log.String("userId", getUserIDFromContext(ctx))
369+
log.String("traceId", getTraceIDFromContext(ctx))
370+
)
364371
// ... processing logic
365372
}
366373
```

0 commit comments

Comments
 (0)