Initial commit
This commit is contained in:
23
elect.go
Normal file
23
elect.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package elect
|
||||
|
||||
import (
|
||||
"github.com/dchest/uniuri"
|
||||
"github.com/go-resty/resty/v2"
|
||||
)
|
||||
|
||||
type Elect struct {
|
||||
client *resty.Client
|
||||
instanceID string
|
||||
signingKey string
|
||||
}
|
||||
|
||||
func New(url string, signingKey string) *Elect {
|
||||
e := &Elect{
|
||||
client: resty.New().
|
||||
SetBaseURL(url),
|
||||
instanceID: uniuri.New(),
|
||||
signingKey: signingKey,
|
||||
}
|
||||
|
||||
return e
|
||||
}
|
||||
Reference in New Issue
Block a user