authentication

package
v0.0.0-...-326cea8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExchangePattern = "/exchange"

	SessionKey  = "session"
	PasswordKey = "pwd"
	UserNameKey = "user"

	UserExtra         = "user_extra"
	PersistSessionKey = "RPC_PERSIST_session"
	PersistPwdKey     = "RPC_PERSIST_pwd"
	PersistUserKey    = "RPC_PERSIST_user"
)

Variables

View Source
var (
	ErrInvalidSession = errors.New("invalid session")
	ErrNotExist       = errors.New("the session is not found")
)

Functions

func NotExistErr

func NotExistErr(err string) bool

Types

type BaseResp

type BaseResp struct {
	StatusMessage string            `json:"StatusMessage"`
	StatusCode    int32             `json:"StatusCode"`
	Extra         map[string]string `json:"Extra"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) Password

func (client *Client) Password() string

func (*Client) Session

func (client *Client) Session(refresh bool) (string, error)

func (*Client) UserName

func (client *Client) UserName() string

type IClient

type IClient interface {
	UserName() string
	Password() string
	Session(bool) (string, error)
}

func NewClient

func NewClient(ops ...Option) IClient

type Option

type Option func(*Options)

Option .

func WithHostPorts

func WithHostPorts(hostsPorts []string) Option

func WithUserPwdSha256

func WithUserPwdSha256(user, pwdSha256 string) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL