werf / lockgate

Lockgate is a cross-platform distributed locking library for Go. Supports distributed locks backed by Kubernetes or HTTP lock server. Supports conventional OS file locks.
Apache License 2.0
256 stars 15 forks source link

Example not working #35

Closed wuestkamp closed 2 years ago

wuestkamp commented 3 years ago

not sure what the issue is, but the example doesn't work, I have to do this:

import (
    "github.com/werf/lockgate/pkg/distributed_locker"
)

func Init() {
    locker := distributed_locker.NewKubernetesLocker(
        k8s.ClientsetDynamic, schema.GroupVersionResource{
            Group:    "",
            Version:  "v1",
            Resource: "configmaps",
        }, "locker", "default",
    )

otherwise I get:

undefined: lockgate.NewKubernetesLocker
distorhead commented 2 years ago

https://github.com/werf/lockgate/pull/37

distorhead commented 2 years ago

Big thanks for creating this issue and giving a feedback!