Documentation
¶
Index ¶
- Constants
- type Provider
- type TLSAuthProvider
- type TokenAuthProvider
- func NewAuthenticationToken(token string, transport http.RoundTripper) (*TokenAuthProvider, error)
- func NewAuthenticationTokenFromAuthParams(encodedAuthParam string, transport http.RoundTripper) (*TokenAuthProvider, error)
- func NewAuthenticationTokenFromFile(tokenFilePath string, transport http.RoundTripper) (*TokenAuthProvider, error)
- type Transport
Constants ¶
View Source
const (
TLSPluginName = "org.apache.pulsar.client.impl.auth.AuthenticationTls"
)
View Source
const (
TokenPluginName = "org.apache.pulsar.client.impl.auth.AuthenticationToken"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶ added in v0.2.0
type Provider interface {
RoundTrip(req *http.Request) (*http.Response, error)
Transport() http.RoundTripper
}
Provider provide a general method to add auth message
type TLSAuthProvider ¶
type TLSAuthProvider struct {
T http.RoundTripper
// contains filtered or unexported fields
}
func NewAuthenticationTLS ¶
func NewAuthenticationTLS(certificatePath string, privateKeyPath string, transport http.RoundTripper) (*TLSAuthProvider, error)
NewAuthenticationTLS initialize the authentication provider
func NewAuthenticationTLSFromAuthParams ¶ added in v0.4.0
func NewAuthenticationTLSFromAuthParams(encodedAuthParams string, transport http.RoundTripper) (*TLSAuthProvider, error)
func (*TLSAuthProvider) GetTLSCertificate ¶
func (p *TLSAuthProvider) GetTLSCertificate() (*tls.Certificate, error)
func (*TLSAuthProvider) Transport ¶ added in v0.4.0
func (p *TLSAuthProvider) Transport() http.RoundTripper
type TokenAuthProvider ¶
type TokenAuthProvider struct {
T http.RoundTripper
// contains filtered or unexported fields
}
func NewAuthenticationToken ¶
func NewAuthenticationToken(token string, transport http.RoundTripper) (*TokenAuthProvider, error)
NewAuthenticationToken return a interface of Provider with a string token.
func NewAuthenticationTokenFromAuthParams ¶ added in v0.4.0
func NewAuthenticationTokenFromAuthParams(encodedAuthParam string, transport http.RoundTripper) (*TokenAuthProvider, error)
func NewAuthenticationTokenFromFile ¶
func NewAuthenticationTokenFromFile(tokenFilePath string, transport http.RoundTripper) (*TokenAuthProvider, error)
NewAuthenticationTokenFromFile return a interface of a Provider with a string token file path.
func (*TokenAuthProvider) Transport ¶ added in v0.4.0
func (p *TokenAuthProvider) Transport() http.RoundTripper
type Transport ¶ added in v0.4.0
type Transport struct {
T http.RoundTripper
}
Click to show internal directories.
Click to hide internal directories.