mirror of
https://github.com/openziti/zrok.git
synced 2025-04-11 21:08:26 +02:00
23 lines
585 B
Go
Executable File
23 lines
585 B
Go
Executable File
package agent
|
|
|
|
import (
|
|
"context"
|
|
"github.com/openziti/zrok/agent/agentGrpc"
|
|
"github.com/pkg/errors"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func (a *Agent) ReleaseShare(shareToken string) error {
|
|
if shr, found := a.shares[shareToken]; found {
|
|
a.rmShare <- shr
|
|
logrus.Infof("released share '%v'", shr.token)
|
|
} else {
|
|
errors.Errorf("agent has no share with token '%v'", shareToken)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (i *agentGrpcImpl) ReleaseShare(_ context.Context, req *agentGrpc.ReleaseShareRequest) (*agentGrpc.ReleaseShareResponse, error) {
|
|
return nil, i.agent.ReleaseShare(req.Token)
|
|
}
|