Skip to content

Commit

Permalink
Added analytics and updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ShardulNalegave committed Feb 21, 2024
1 parent 7acdafe commit ce90108
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@

# Freighter
Simple Load-Balancer written in Go-lang.

Freighter is not a pre-built binary/CLI-application, instead it is a Go library which you can add to your own binary.
This allows you to very easily extend its functionality and maybe even add new features which you require. Also, this helps avoid unnecessarily complicated configuration files.

**Documentation:** https://shardulnalegave.github.io/freighter

```go
package main

import (
"net/url"
"time"

"github.com/ShardulNalegave/freighter"
"github.com/ShardulNalegave/freighter/pool"
"github.com/ShardulNalegave/freighter/strategy"
)

func main() {
srv := freighter.NewFreighter(&freighter.Options{
URL: &url.URL{
Host: ":5000",
},
EnableConsoleLogging: true,
HealthCheckInterval: time.Second * 5,
Strategy: &strategy.RoundRobin{},
Backends: []*pool.Backend{
pool.NewBackend(&url.URL{Host: ":8080", Scheme: "http"}, nil),
pool.NewBackend(&url.URL{Host: ":8081", Scheme: "http"}, nil),
},
})

srv.ListenAndServe()
}
```
15 changes: 14 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,18 @@ export default defineConfig({
socialLinks: [
{ icon: 'github', link: 'https://github.com/ShardulNalegave/freighter' }
]
}
},
head: [
[
'script',
{
src: 'https://www.googletagmanager.com/gtag/js?id=G-JCJH9KGFWV',
},
],
[
'script',
{},
"window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-JCJH9KGFWV');",
],
],
})

0 comments on commit ce90108

Please sign in to comment.