Documentation ¶
Index ¶
- Constants
- func DecodeAccessPolicy(raw []byte) map[string]any
- func EncodeAccessPolicy(policy map[string]any) []byte
- func LinkAccountMiddleware[T any](tx *gorm.DB, table string, adaptor func(u BaseUser) T) func(c *fiber.Ctx) error
- type BaseModel
- type BaseRealm
- type BaseUser
- type HyperConn
- func (v *HyperConn) AuthMiddleware(c *fiber.Ctx) error
- func (v *HyperConn) CheckPermGranted(atk string, key string, val []byte) error
- func (v *HyperConn) DoAuthenticate(atk, rtk string) (acc *proto.UserInfo, accessTk string, refreshTk string, err error)
- func (v *HyperConn) EnsureAuthenticated(c *fiber.Ctx) error
- func (v *HyperConn) EnsureGrantedPerm(c *fiber.Ctx, key string, val any) error
- func (v *HyperConn) GetDealerGrpcConn() *grpc.ClientConn
- func (v *HyperConn) GetServiceGrpcConn(t string) (*grpc.ClientConn, error)
- func (v *HyperConn) KeepRegisterService() error
- func (v *HyperConn) RecordAuditLog(user uint, action, target, ip, ua string) error
- func (v *HyperConn) RegisterService() error
- type NetworkPackage
Constants ¶
View Source
const ( CookieAtk = "__hydrogen_atk" CookieRtk = "__hydrogen_rtk" )
View Source
const ( ServiceTypeAuthProvider = "auth" ServiceTypeFileProvider = "files" ServiceTypeInteractiveProvider = "interactive" ServiceTypeMessagingProvider = "messaging" )
Variables ¶
This section is empty.
Functions ¶
func DecodeAccessPolicy ¶
func EncodeAccessPolicy ¶
Types ¶
type BaseRealm ¶
type BaseRealm struct { BaseModel Alias string `json:"alias"` Name string `json:"name"` Description string `json:"description"` Avatar string `json:"avatar"` Banner string `json:"banner"` IsPublic bool `json:"is_public"` IsCommunity bool `json:"is_community"` AccessPolicy datatypes.JSONMap `json:"access_policy"` }
type BaseUser ¶
type BaseUser struct { BaseModel Name string `json:"name"` Nick string `json:"nick"` Avatar string `json:"avatar"` Banner string `json:"banner"` Description string `json:"description"` EmailAddress string `json:"email_address"` AffiliatedTo *uint `json:"affiliated_to"` AutomatedBy *uint `json:"automated_by"` }
type HyperConn ¶
type HyperConn struct { Addr string Info *proto.ServiceInfo // contains filtered or unexported fields }
func NewHyperConn ¶
func NewHyperConn(addr string, info *proto.ServiceInfo) (*HyperConn, error)
func (*HyperConn) AuthMiddleware ¶
func (*HyperConn) CheckPermGranted ¶
func (*HyperConn) DoAuthenticate ¶
func (*HyperConn) EnsureAuthenticated ¶
func (*HyperConn) EnsureGrantedPerm ¶
func (*HyperConn) GetDealerGrpcConn ¶
func (v *HyperConn) GetDealerGrpcConn() *grpc.ClientConn
func (*HyperConn) GetServiceGrpcConn ¶
func (v *HyperConn) GetServiceGrpcConn(t string) (*grpc.ClientConn, error)
func (*HyperConn) KeepRegisterService ¶
func (*HyperConn) RecordAuditLog ¶
func (*HyperConn) RegisterService ¶
type NetworkPackage ¶
type NetworkPackage struct { Action string `json:"w"` Endpoint string `json:"e,omitempty"` Message string `json:"m,omitempty"` Payload any `json:"p"` }
func (NetworkPackage) Marshal ¶
func (v NetworkPackage) Marshal() []byte
func (NetworkPackage) RawPayload ¶
func (v NetworkPackage) RawPayload() []byte
Click to show internal directories.
Click to hide internal directories.