Documentation
¶
Index ¶
- Constants
- func DecodeClaims[T any](str string, decoder claimsDecoder[T]) (claims *T, err error)
- func DecodeUserClaims(str string) (*jwt.UserClaims, error)
- func IsEndOfStream(msg *nats.Msg) (result bool, err error)
- func IsEndOfStreamErr(err error) bool
- func NKeyForPublicKey(pk ssh.PublicKey) (string, error)
- func NKeyForPublicKeyFile(file *os.File) (string, error)
- func NKeyForSigner(signer ssh.Signer) (string, error)
- func NewSigner(path string) (signer ssh.Signer, err error)
- func ReadClaims[T any](path string, decoder claimsDecoder[T]) (claims *T, err error)
- func ReadClaimsFile[T any](file *os.File, decoder claimsDecoder[T]) (claims *T, err error)
- func ReadCredentials(path string) (nkey nkeys.KeyPair, jwt string, err error)
- func ReadCredentialsFile(file *os.File) (nkey nkeys.KeyPair, jwt string, err error)
- func ReadProfile(url string) (profile cmd.Profile, nkey nkeys.KeyPair, jwt string, err error)
- func ReadUserClaims(path string) (*jwt.UserClaims, error)
- func Request[Req any, Resp any](conn *nats.EncodedConn, subject string, req Req, resp *Resp, ...) error
- func RequestWithContext[Req any, Resp any](ctx context.Context, conn *nats.EncodedConn, subject string, req Req, ...) (err error)
- type CliOptions
- type EndOfStreamErr
- type Reader
- type RequestError
- type Writer
Constants ¶
View Source
const ( EOS = "EOS" EOSValue = "End-Of-Stream" )
Variables ¶
This section is empty.
Functions ¶
func DecodeClaims ¶
func DecodeUserClaims ¶
func DecodeUserClaims(str string) (*jwt.UserClaims, error)
func IsEndOfStreamErr ¶
func ReadClaims ¶
func ReadClaimsFile ¶
func ReadCredentials ¶
func ReadCredentialsFile ¶
func ReadProfile ¶
func ReadUserClaims ¶
func ReadUserClaims(path string) (*jwt.UserClaims, error)
func RequestWithContext ¶
Types ¶
type CliOptions ¶
type CliOptions struct {
Url string `env:"NATS_URL" default:"nats://127.0.0.1:4222" help:"NATS server url."`
Profile string `env:"NATS_PROFILE" help:"profile url in the form nsc://<OPERATOR>/<ACCOUNT>/<USER> e.g. nsc://Nits/Numtide/Admin"`
JwtFile string `type:"existingfile" env:"NATS_JWT_FILE"`
HostKeyFile string `type:"existingfile" env:"NATS_HOST_KEY_FILE"`
CredentialsFile string `type:"existingfile" env:"NATS_CREDENTIALS_FILE"`
}
func (*CliOptions) ToNatsOptions ¶
func (c *CliOptions) ToNatsOptions() (opts []nats.Option, nkey string, claims *jwt.UserClaims, err error)
type EndOfStreamErr ¶
type EndOfStreamErr struct {
Subject string
}
func (EndOfStreamErr) Error ¶
func (e EndOfStreamErr) Error() string
type Reader ¶
type Reader struct {
Sub *nats.Subscription
Context context.Context
// contains filtered or unexported fields
}
type RequestError ¶
func (*RequestError) Error ¶
func (r *RequestError) Error() string
Click to show internal directories.
Click to hide internal directories.