Documentation
¶
Index ¶
- Constants
- Variables
- func IsMemberOfGroup(ctx context.Context, name string) bool
- type Capacity
- type Catalog
- type CatalogStatus
- type Event
- func (e *Event) ComposeMailBody() (string, error)
- func (e *Event) SetLog(level EventLogLevel, message string)
- func (e *Event) SetNotified(b bool)
- func (e *Event) SetNotifiyBoth()
- func (e *Event) SetNotify()
- func (e *Event) SetNotifyAdmin()
- func (e *Event) SetType(t EventType)
- func (e *Event) SetUserID(id string)
- type EventLog
- type EventLogLevel
- type EventResponse
- type EventType
- type Group
- type GroupAdmission
- type Key
- type Links
- type NewRequest
- type Quota
- type Request
- type RequestStateType
- type RequestType
- type Service
- type ServiceExpiry
- type ServiceStatus
- type TermsAndConditions
- type User
- type VM
Constants ¶
View Source
const ( EventGroupJoinRequest EventType = "GROUP_JOIN_REQUEST" EventServiceExpiryRequest EventType = "SERVICE_EXPIRY_REQUEST" EventGroupExitRequest EventType = "GROUP_EXIT_REQUEST" EventServiceExpiryNotification EventType = "SERVICE_EXPIRY_NOTIFICATION" EventServiceExpiredNotification EventType = "SERVICE_EXPIRED_NOTIFICATION" EventDeletUserRequest EventType = "DELETE_USER_REQUEST" EventTypeRequestApproved EventType = "REQUEST_APPROVED" EventTypeRequestRejected EventType = "REQUEST_REJECTED" EventTypeRequestDeleted EventType = "REQUEST_DELETED" EventCatalogCreate EventType = "CATALOG_CREATE" EventCatalogUpdate EventType = "CATALOG_UPDATE" EventCatalogDelete EventType = "CATALOG_DELETE" EventCatalogRetire EventType = "CATALOG_RETIRE" EventServiceCreate EventType = "SERVICE_CREATE" EventServiceUpdate EventType = "SERVICE_UPDATE" EventServiceDelete EventType = "SERVICE_DELETE" EventServiceDeleteFailed EventType = "SERVICE_DELETE_FAILED" EventLogLevelINFO EventLogLevel = "INFO" EventLogLevelERROR EventLogLevel = "ERROR" )
View Source
const ( RequestStateNew RequestStateType = "NEW" RequestStateApproved RequestStateType = "APPROVED" RequestStateRejected RequestStateType = "REJECTED" RequestAddToGroup RequestType = "GROUP" RequestExitFromGroup RequestType = "GROUP_EXIT" RequestExtendServiceExpiry RequestType = "SERVICE_EXPIRY" RequestStateExpired RequestStateType = "EXPIRED" RequestDeleteUser RequestType = "USER_DELETE" )
Variables ¶
View Source
var ExcludeGroups []string
ExcludeGroups is a list of groups to exclude from the list of groups
View Source
var ExpiryNotificationDuration time.Duration
Functions ¶
Types ¶
type Catalog ¶
type Catalog struct {
ID string `json:"id"`
Type string `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
Capacity Capacity `json:"capacity"`
Retired bool `json:"retired"`
Expiry int `json:"expiry"`
ImageThumbnailReference string `json:"image_thumbnail_reference"`
VM VM `json:"vm"`
Status CatalogStatus `json:"status"`
}
type CatalogStatus ¶
type Event ¶ added in v0.3.0
type Event struct {
// ID is the event identifier
ID primitive.ObjectID `json:"id" bson:"_id,omitempty"`
// EventType is the event type
Type EventType `json:"type" bson:"type"`
// CreatedAt is the time the event was created
CreatedAt time.Time `json:"created_at" bson:"created_at"`
// Originator is the user that created the event
Originator string `json:"originator" bson:"originator"`
// UserID is the user that the event is about
UserID string `json:"user_id" bson:"user_id"`
// UserEmail is the user email that the event is about
UserEmail string `json:"user_email" bson:"user_email"`
// Notify is a flag to indicate if the user should be notified
Notify bool `json:"notify" bson:"notify"`
// NotifyAdmin is a flag to indicate if the admin should be notified
NotifyAdmin bool `json:"notify_admin" bson:"notify_admin"`
// Notified is a flag to indicate if the user has been notified
Notified bool `json:"notified" bson:"notified"`
// Log contains all the event information
Log EventLog `json:"log" bson:"log"`
}
func (*Event) ComposeMailBody ¶ added in v0.3.0
func (*Event) SetLog ¶ added in v0.3.0
func (e *Event) SetLog(level EventLogLevel, message string)
func (*Event) SetNotified ¶ added in v0.3.0
SetNotified sets the notified flag
func (*Event) SetNotifiyBoth ¶ added in v0.3.0
func (e *Event) SetNotifiyBoth()
SetNotifiyBoth sets both Notify and NotifyAdmin to true
func (*Event) SetNotify ¶ added in v0.3.0
func (e *Event) SetNotify()
SetNotify sets the notify flag
func (*Event) SetNotifyAdmin ¶ added in v0.3.0
func (e *Event) SetNotifyAdmin()
SetNotifyAdmin sets the notify admin flag
type EventLog ¶ added in v0.3.0
type EventLog struct {
Level EventLogLevel `json:"level" bson:"level"`
Message string `json:"message" bson:"message"`
}
type EventLogLevel ¶ added in v0.3.0
type EventLogLevel string
type EventResponse ¶ added in v0.3.0
type EventResponse struct {
// TotalPages is the total number of pages
TotalPages int64 `json:"total_pages"`
// TotalItems is the total number of items
TotalItems int64 `json:"total_items"`
// Events is the list of events
Events []Event `json:"events"`
// Links contains the links for the current page, next page and last page
Links Links `json:"links"`
}
type GroupAdmission ¶
type Key ¶
type NewRequest ¶
type NewRequest struct {
Justification string `json:"justification"`
}
func GetNewRequest ¶
func GetNewRequest() NewRequest
type Request ¶
type Request struct {
ID primitive.ObjectID `json:"id" bson:"_id,omitempty"`
UserID string `json:"user_id" bson:"user_id,omitempty"`
Justification string `json:"justification" bson:"justification,omitempty"`
Comment string `json:"comment" bson:"comment,omitempty"`
CreatedAt time.Time `json:"created_at" bson:"created_at,omitempty"`
State RequestStateType `json:"state" bson:"state,omitempty"`
RequestType RequestType `json:"type" bson:"type,omitempty"`
GroupAdmission *GroupAdmission `json:"group,omitempty" bson:"group,omitempty"`
ServiceExpiry *ServiceExpiry `json:"service,omitempty" bson:"service,omitempty"`
}
func GetRequest ¶
func GetRequest() Request
func GetRequests ¶
func GetRequests() []Request
type RequestStateType ¶
type RequestStateType string
type RequestType ¶
type RequestType string
type Service ¶
type Service struct {
ID string `json:"id"`
UserID string `json:"user_id"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
CatalogName string `json:"catalog_name"`
Expiry time.Time `json:"expiry"`
Status ServiceStatus `json:"status"`
}
Service will have the details of the user provisioned service from catalog
type ServiceExpiry ¶
type ServiceStatus ¶
type TermsAndConditions ¶ added in v0.3.2
type TermsAndConditions struct {
// UserID is the user who accepted the terms and conditions
UserID string `json:"user_id" bson:"user_id"`
// Accepted is the flag that indicates if the user accepted the terms and conditions
Accepted bool `json:"accepted" bson:"accepted"`
// AcceptedAt is the timestamp when the user accepted the terms and conditions
AcceptedAt *time.Time `json:"accepted_at,omitempty" bson:"accepted_at"`
}
Click to show internal directories.
Click to hide internal directories.