Documentation ¶
Index ¶
- Constants
- func AddAuthRoute(method string, path string, key PermissionKey, handler gin.HandlerFunc)
- func AddRoute(method string, path string, handler gin.HandlerFunc)
- func AmqpConnection() *amqp.Connection
- func Database() *gorm.DB
- func EnsureEnv(key string)
- func GrantPermission(roleID uuid.UUID, key PermissionKey)
- func HasPermission(roleID uuid.UUID, key PermissionKey) bool
- func Init()
- func Logger() *zap.Logger
- func PermissionMiddleware(key PermissionKey) gin.HandlerFunc
- func PublishOnQueue(queueName string, data []byte) error
- func RevokePermission(roleID uuid.UUID, key PermissionKey)
- func Start()
- func SubscribeToQueue(queueName string, consumerName string, handlerFunc func(amqp.Delivery)) error
- func SysAdminRoleID() uuid.UUID
- func SystemRoleID() uuid.UUID
- type ApiCaller
- type IForm
- type IModel
- type IRepository
- type InternalError
- type Model
- type Permission
- type PermissionKey
- type Permissions
- type SysResponse
- type SystemForm
- type ValidationError
Constants ¶
View Source
const ( // TODO: this should not be hard-coded AuthUrl string = "http://auth:8000/sys" )
View Source
const (
// TODO: set this from the build system
SystemSecret = "%*TyBvO0bcBaaAkds93#mJ7&dokdyY0_23gHnqzpMM312"
)
Variables ¶
This section is empty.
Functions ¶
func AddAuthRoute ¶
func AddAuthRoute( method string, path string, key PermissionKey, handler gin.HandlerFunc, )
func AmqpConnection ¶
func AmqpConnection() *amqp.Connection
func GrantPermission ¶
func GrantPermission(roleID uuid.UUID, key PermissionKey)
func HasPermission ¶
func HasPermission(roleID uuid.UUID, key PermissionKey) bool
func PermissionMiddleware ¶
func PermissionMiddleware(key PermissionKey) gin.HandlerFunc
func PublishOnQueue ¶
func RevokePermission ¶
func RevokePermission(roleID uuid.UUID, key PermissionKey)
func SubscribeToQueue ¶
func SysAdminRoleID ¶
func SystemRoleID ¶
Types ¶
type IRepository ¶
type InternalError ¶
type InternalError struct{}
func (*InternalError) Error ¶
func (e *InternalError) Error() string
type Permission ¶
type Permission struct { Model RoleID uuid.UUID `gorm:"type:uuid;uniqueIndex:permindex" json:"role_id"` Key PermissionKey `gorm:"uniqueIndex:permindex" json:"permission"` }
type Permissions ¶
type Permissions []Permission
type SysResponse ¶
type SystemForm ¶
type SystemForm struct {
Secret string `json:"secret" binding:"required"`
}
type ValidationError ¶
type ValidationError struct {
Errors []string
}
func (*ValidationError) AddError ¶
func (e *ValidationError) AddError(err string)
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
func (*ValidationError) HasErrors ¶
func (e *ValidationError) HasErrors() bool
Click to show internal directories.
Click to hide internal directories.