Skip to content

Commit

Permalink
Go: update line numbers in code snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloFuente committed Oct 22, 2024
1 parent 12718d8 commit 275f06c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/tutorials/application-server/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The application is a simple Go app with a single file `main.go` that exports two

Let's see the code of the `main.go` file:

```go title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/go/main.go/#L15-L17' target='_blank'>main.go</a>" linenums="14"
```go title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/go/main.go/#L15-L17' target='_blank'>main.go</a>" linenums="15"
var SERVER_PORT string // (1)!
var LIVEKIT_API_KEY string // (2)!
var LIVEKIT_API_SECRET string // (3)!
Expand All @@ -50,7 +50,7 @@ The `main.go` file first declares the necessary global variables:

The server launch takes place in the `main` function at the end of the file, where we first load the environment variables, then set the REST endpoints and finally start the server on `SERVER_PORT`:

```go title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/go/main.go#L63-L70' target='_blank'>main.go</a>" linenums="71"
```go title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/go/main.go#L63-L70' target='_blank'>main.go</a>" linenums="63"
func main() {
loadEnv() // (1)!
router := gin.Default() // (2)!
Expand All @@ -77,7 +77,7 @@ The endpoint `/token` accepts `POST` requests with a payload of type `applicatio
- `roomName`: the name of the Room where the user wants to connect.
- `participantName`: the name of the participant that wants to connect to the Room.

```go title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/go/main.go#L19-L49' target='_blank'>main.go</a>" linenums="27"
```go title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/go/main.go#L19-L49' target='_blank'>main.go</a>" linenums="19"
func createToken(context *gin.Context) {
var body struct {
RoomName string `json:"roomName"`
Expand Down Expand Up @@ -131,7 +131,7 @@ If required fields are available, a new JWT token is created. For that we use th

The endpoint `/livekit/webhook` accepts `POST` requests with a payload of type `application/webhook+json`. This is the endpoint where LiveKit Server will send [webhook events](https://docs.livekit.io/realtime/server/webhooks/#Events){:target="\_blank"}.

```go title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/go/main.go#L51-L61' target='_blank'>main.go</a>" linenums="59"
```go title="<a href='https://github.com/OpenVidu/openvidu-livekit-tutorials/blob/master/application-server/go/main.go#L51-L61' target='_blank'>main.go</a>" linenums="51"
func receiveWebhook(context *gin.Context) {
authProvider := auth.NewSimpleKeyProvider( // (1)!
LIVEKIT_API_KEY, LIVEKIT_API_SECRET,
Expand Down

0 comments on commit 275f06c

Please sign in to comment.