Documentation ¶
Index ¶
- Constants
- func DialInsecure(target string) (cConn *grpc.ClientConn, err error)
- func DialWithSecurity(target string, clientCert, clientKey, serverName, serverCa string) (cConn *grpc.ClientConn, err error)
- func FromContext(ctx context.Context, key ContextKey) (string, bool)
- func Load(spec any) error
- func NewContext(ctx context.Context, key ContextKey, value string) context.Context
- type ContextKey
- type Deployments
- type Tag
- type WithoutAuth
Constants ¶
View Source
const Timeout = 2 * time.Second
Timeout grpc dial timeout
Variables ¶
This section is empty.
Functions ¶
func DialInsecure ¶ added in v0.0.24
func DialInsecure(target string) (cConn *grpc.ClientConn, err error)
DialInsecure dial insecure grpc
func DialWithSecurity ¶ added in v0.0.24
func DialWithSecurity(target string, clientCert, clientKey, serverName, serverCa string) (cConn *grpc.ClientConn, err error)
DialWithSecurity dial grpc with security
func FromContext ¶
func FromContext(ctx context.Context, key ContextKey) (string, bool)
func NewContext ¶
Types ¶
type ContextKey ¶
type ContextKey string
const ( TokenContextKey ContextKey = "bearer" UIDContextKey ContextKey = "uid" )
type Deployments ¶
type Deployments string
const ( DeploymentsLocal Deployments = "local" DeploymentsDev Deployments = "dev" DeploymentsProd Deployments = "prod" )
func ParseDeployments ¶
func ParseDeployments(value string) Deployments
func (Deployments) IsProd ¶ added in v0.0.15
func (d Deployments) IsProd() bool
func (Deployments) String ¶
func (d Deployments) String() string
type WithoutAuth ¶ added in v0.0.19
type WithoutAuth struct{}
WithoutAuth overrides the default auth behavior and allows all methods to be called without an access token.
func (*WithoutAuth) AuthFuncOverride ¶ added in v0.0.19
AuthFuncOverride allows all methods to be unauthenticated.
Click to show internal directories.
Click to hide internal directories.