Versions in this module Expand all Collapse all v0 v0.0.1 Dec 4, 2022 Changes in this version + var DefaultRetry = 3 + var DefaultTimeout = 15 + func DefaultMakeChallengeCode() ([]byte, error) + func DefaultPopChallengeCode(user string) ([]byte, error) + func DefaultStoreChallengeCode(user string, code []byte) error + type Options struct + AuthToken string + HttpHeaders map[string]string + HttpKeepalive bool + HttpProxy string + Password string + PrivatekeyPassword string + PrivatekeyPath string + RequestRetry int + RequestTimeout int + SkipSSLVerify bool + TLS TLS + User string + UserAgent string + type Response struct + Body []byte + Headers map[string]string + StatusCode int + type STNS struct + func NewSTNS(endpoint string, opt *Options) (*STNS, error) + func (c *STNS) CreateUserChallengeCode(name string) ([]byte, error) + func (c *STNS) PopUserChallengeCode(name string) ([]byte, error) + func (c *STNS) Sign(code []byte) ([]byte, error) + func (c *STNS) Verify(msg, publicKeyBytes, signature []byte) error + func (c *STNS) VerifyWithUser(name string, msg, signature []byte) error + func (s *STNS) GetGroupByID(id int) (*model.Group, error) + func (s *STNS) GetGroupByName(name string) (*model.Group, error) + func (s *STNS) GetUserByID(id int) (*model.User, error) + func (s *STNS) GetUserByName(name string) (*model.User, error) + func (s *STNS) ListGroup() ([]*model.Group, error) + func (s *STNS) ListUser() ([]*model.User, error) + func (s *STNS) Request(path, query string) (*Response, error) + func (s *STNS) SetPopChallengeCode(f func(string) ([]byte, error)) + func (s *STNS) SetStoreChallengeCode(f func(string, []byte) error) + type TLS struct + CA string + Cert string + Key string