Documentation ¶
Index ¶
- Variables
- func AppendFile(filename string, filePerm os.FileMode, format string, args ...interface{}) error
- func BackupFile(filePath string, filePerm os.FileMode) (int64, error)
- func CopyFile(src string, dst string, perm os.FileMode) (int64, error)
- func CreateFileIfNeeded(fileName string, fileperm os.FileMode) error
- func DecodeId(base62str string) (uint64, error)
- func DecodeLongId(base62str string) ([]byte, error)
- func EncodeId(id uint64) string
- func EncodeLongId(id []byte) string
- func FindGatewayHandler(srv *http.Server, pattern string) (*rt.ServeMux, error)
- func GenerateAuthToken(secretKey []byte, user *sauce.AuthorizedUser) (string, error)
- func GenerateLongId() (string, error)
- func GenerateNodeId() (string, error)
- func GenerateToken() (string, error)
- func IsFileLocked(filePath string) bool
- func PackGzipData(plain []byte) ([]byte, error)
- func ParseClientAuth(s string) tls.ClientAuthType
- func ParseFileMode(s string) os.FileMode
- func ParseNodeId(nodeId string) (uint64, error)
- func ParseToken(base64key string) ([]byte, error)
- func Prompt(request string) string
- func PromptPEM(request string) (string, error)
- func PromptPassword(request string) string
- func PromptQuery(request string) string
- func Promptf(request string, args ...interface{}) string
- func RemoveFileIfExist(filePath string) error
- func ToFqdn(name string) string
- func ToZone(domain string) (string, error)
- func UnFqdn(name string) string
- func UnpackGzipData(compressed []byte) ([]byte, error)
- func UnpackGzipFile(inputFilePath, outputFilePath string, filePerm os.FileMode) (int64, error)
- func UnpackTarGzipFile(fileName string, inputFilePath, outputFilePath string, filePerm os.FileMode) (int64, error)
- func VerifyAuthToken(secretKey []byte, jwtToken string) (*sauce.AuthorizedUser, error)
- type RateLimiter
- type UserClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultTokenSize = 32 // 256-bit AES key DefaultLongIdSize = 16 // 128-bit NodeIdBits = 48 NodeIdSize = NodeIdBits / 8 Encoding = base64.RawURLEncoding )
Functions ¶
func AppendFile ¶
func DecodeLongId ¶
func EncodeLongId ¶
func FindGatewayHandler ¶
func GenerateAuthToken ¶
func GenerateAuthToken(secretKey []byte, user *sauce.AuthorizedUser) (string, error)
func GenerateLongId ¶
func GenerateNodeId ¶
func GenerateToken ¶
func IsFileLocked ¶
func PackGzipData ¶
func ParseClientAuth ¶
func ParseClientAuth(s string) tls.ClientAuthType
func ParseFileMode ¶
* Parses only os.Unix file mode with 0777 mask
func ParseNodeId ¶
func ParseToken ¶
func PromptPassword ¶
func PromptQuery ¶
func RemoveFileIfExist ¶
func UnpackGzipData ¶
func UnpackGzipFile ¶
func UnpackTarGzipFile ¶
func VerifyAuthToken ¶
func VerifyAuthToken(secretKey []byte, jwtToken string) (*sauce.AuthorizedUser, error)
Types ¶
type RateLimiter ¶
func (*RateLimiter) Do ¶
func (t *RateLimiter) Do(fn func() error) error
type UserClaims ¶
type UserClaims struct { Roles []string `json:"roles"` Context map[string]string `json:"ctx"` jwt.StandardClaims }
Click to show internal directories.
Click to hide internal directories.