Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidRoleType = errors.New("Invalid role type") ErrInvalidApiKey = errors.New("Invalid API Key") ErrInvalidOrgId = errors.New("Invalid Org Id") ErrInvalidInstanceID = errors.New("Invalid Instance ID") ErrInvalidInstanceType = errors.New("Invalid Instance Type") ErrInvalidCluster = errors.New("Invalid Cluster") )
Typed errors
Functions ¶
func InitInstanceCache ¶
func InitInstanceCache()
func InitTokenCache ¶
func InitTokenCache()
func StopInstanceCache ¶
func StopInstanceCache()
func StopTokenCache ¶
func StopTokenCache()
func ValidateInstance ¶
Types ¶
type InstanceCache ¶
func (*InstanceCache) Clear ¶
func (c *InstanceCache) Clear()
func (*InstanceCache) Set ¶
func (c *InstanceCache) Set(key string, valid bool)
type InstanceResp ¶
type InstanceResp struct {
// contains filtered or unexported fields
}
type SignedInUser ¶
type SignedInUser struct { Id int64 `json:"id"` OrgName string `json:"orgName"` OrgId int64 `json:"orgId"` OrgSlug string `json:"orgSlug"` Name string `json:"name"` Role RoleType `json:"role"` CreatedAt time.Time `json:"createAt"` IsAdmin bool `json:"-"` // contains filtered or unexported fields }
func Auth ¶
func Auth(adminKey, keyString string) (*SignedInUser, error)
func ValidateToken ¶
func ValidateToken(keyString string) (*SignedInUser, error)
func (*SignedInUser) CheckInstance ¶
func (u *SignedInUser) CheckInstance(instanceID string) error
validate that the signedInUser has a hosted-metrics instance with the passed instanceID. It is assumed that the instanceID has already been confirmed to be an integer.
type TokenCache ¶
func (*TokenCache) Clear ¶
func (c *TokenCache) Clear()
func (*TokenCache) Get ¶
func (c *TokenCache) Get(key string) (*SignedInUser, bool)
func (*TokenCache) Set ¶
func (c *TokenCache) Set(key string, u *SignedInUser)
type TokenResp ¶
type TokenResp struct { User *SignedInUser // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.