-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added analytics and updated README.md
- Loading branch information
1 parent
7acdafe
commit ce90108
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters