Documentation
¶
Index ¶
- Constants
- Variables
- func CastFloatToStr(val float64) string
- func CastStrToFloat(val string) (float64, error)
- func ValidateQuotaFields(c *gin.Context, cpuCap float64, memCap int) error
- type KeyClockClient
- func (k *KeyClockClient) AddUserToGroup(userID, groupID string) error
- func (k *KeyClockClient) DeleteUserFromGroup(userID, groupID string) error
- func (k *KeyClockClient) GetClient() *gocloak.GoCloak
- func (k *KeyClockClient) GetGroup(id string) (*models.Group, error)
- func (k *KeyClockClient) GetGroups() ([]models.Group, error)
- func (k *KeyClockClient) GetUser(id string) (*models.User, error)
- func (k *KeyClockClient) GetUserGroups() []models.Group
- func (k *KeyClockClient) GetUserID() string
- func (k *KeyClockClient) GetUsers() ([]models.User, error)
- func (k *KeyClockClient) IsMemberOfGroup(name string) bool
- func (k *KeyClockClient) IsRole(name string) bool
Constants ¶
View Source
const (
ManagerRole = "manager"
)
Variables ¶
View Source
var ( ErrorGroupNotFound = errors.New("group not found") ErrorUserNotFound = errors.New("user not found") )
Functions ¶
func CastFloatToStr ¶
func CastStrToFloat ¶
Types ¶
type KeyClockClient ¶
type KeyClockClient struct {
// contains filtered or unexported fields
}
func NewKeyClockClient ¶
func NewKeyClockClient(ctx context.Context) *KeyClockClient
func (*KeyClockClient) AddUserToGroup ¶
func (k *KeyClockClient) AddUserToGroup(userID, groupID string) error
func (*KeyClockClient) DeleteUserFromGroup ¶
func (k *KeyClockClient) DeleteUserFromGroup(userID, groupID string) error
func (*KeyClockClient) GetClient ¶
func (k *KeyClockClient) GetClient() *gocloak.GoCloak
func (*KeyClockClient) GetGroup ¶
func (k *KeyClockClient) GetGroup(id string) (*models.Group, error)
func (*KeyClockClient) GetUser ¶
func (k *KeyClockClient) GetUser(id string) (*models.User, error)
GetUser by ID
func (*KeyClockClient) GetUserGroups ¶
func (k *KeyClockClient) GetUserGroups() []models.Group
func (*KeyClockClient) GetUserID ¶
func (k *KeyClockClient) GetUserID() string
func (*KeyClockClient) GetUsers ¶
func (k *KeyClockClient) GetUsers() ([]models.User, error)
GetUsers for listing all the users from keycloak
func (*KeyClockClient) IsMemberOfGroup ¶
func (k *KeyClockClient) IsMemberOfGroup(name string) bool
func (*KeyClockClient) IsRole ¶
func (k *KeyClockClient) IsRole(name string) bool
Click to show internal directories.
Click to hide internal directories.