github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/discovery/discovery.go (about)

     1  package discovery
     2  
     3  import (
     4  	"context"
     5  	"fmt"
     6  	"strings"
     7  
     8  	"github.com/ydb-platform/ydb-go-sdk/v3/internal/endpoint"
     9  )
    10  
    11  type WhoAmI struct {
    12  	User   string
    13  	Groups []string
    14  }
    15  
    16  func (w WhoAmI) String() string {
    17  	return fmt.Sprintf("{User: %s, Groups: [%s]}", w.User, strings.Join(w.Groups, ","))
    18  }
    19  
    20  type Client interface {
    21  	Discover(ctx context.Context) ([]endpoint.Endpoint, error)
    22  	WhoAmI(ctx context.Context) (*WhoAmI, error)
    23  }