Documentation
¶
Index ¶
- Variables
- func Encrypt(password string) ([]byte, []byte)
- type ClaimAuth
- func (*ClaimAuth) Descriptor() ([]byte, []int)
- func (this *ClaimAuth) Equal(that interface{}) bool
- func (this *ClaimAuth) GoString() string
- func (m *ClaimAuth) Marshal() (dAtA []byte, err error)
- func (m *ClaimAuth) MarshalTo(dAtA []byte) (int, error)
- func (m *ClaimAuth) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ClaimAuth) ProtoMessage()
- func (m *ClaimAuth) Reset()
- func (m *ClaimAuth) Size() (n int)
- func (this *ClaimAuth) String() string
- func (m *ClaimAuth) Unmarshal(dAtA []byte) error
- func (m *ClaimAuth) XXX_DiscardUnknown()
- func (m *ClaimAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ClaimAuth) XXX_Merge(src proto.Message)
- func (m *ClaimAuth) XXX_Size() int
- func (m *ClaimAuth) XXX_Unmarshal(b []byte) error
- type ClaimGroup
- func (*ClaimGroup) Descriptor() ([]byte, []int)
- func (this *ClaimGroup) Equal(that interface{}) bool
- func (this *ClaimGroup) GoString() string
- func (m *ClaimGroup) Marshal() (dAtA []byte, err error)
- func (m *ClaimGroup) MarshalTo(dAtA []byte) (int, error)
- func (m *ClaimGroup) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ClaimGroup) ProtoMessage()
- func (c ClaimGroup) Require(rs ...Requirement) error
- func (m *ClaimGroup) Reset()
- func (m *ClaimGroup) Size() (n int)
- func (this *ClaimGroup) String() string
- func (m *ClaimGroup) Unmarshal(dAtA []byte) error
- func (m *ClaimGroup) XXX_DiscardUnknown()
- func (m *ClaimGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ClaimGroup) XXX_Merge(src proto.Message)
- func (m *ClaimGroup) XXX_Size() int
- func (m *ClaimGroup) XXX_Unmarshal(b []byte) error
- type ClaimResources
- func (*ClaimResources) Descriptor() ([]byte, []int)
- func (this *ClaimResources) Equal(that interface{}) bool
- func (this *ClaimResources) GoString() string
- func (m *ClaimResources) Marshal() (dAtA []byte, err error)
- func (m *ClaimResources) MarshalTo(dAtA []byte) (int, error)
- func (m *ClaimResources) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ClaimResources) ProtoMessage()
- func (m *ClaimResources) Reset()
- func (m *ClaimResources) Size() (n int)
- func (this *ClaimResources) String() string
- func (m *ClaimResources) Unmarshal(dAtA []byte) error
- func (m *ClaimResources) XXX_DiscardUnknown()
- func (m *ClaimResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ClaimResources) XXX_Merge(src proto.Message)
- func (m *ClaimResources) XXX_Size() int
- func (m *ClaimResources) XXX_Unmarshal(b []byte) error
- type Claims
- type Command
- type ErrEmptyEmail
- type ErrEmptyName
- type ErrEmptyPermissions
- type ErrForbiddenAdminRole
- type ErrInvalidClaims
- type ErrInvalidEmailLength
- type ErrInvalidNameLength
- type ErrInvalidPassword
- type ErrUnauthorizedCommand
- type ErrUnauthorizedResource
- type ErrUnauthorizedRole
- type ErrUnknownCommand
- type ErrUnknownGroup
- type ErrUnknownResource
- type Filter
- type FilterGroup
- type FilterInvitation
- type FilterInvitationRole
- type FilterPermission
- type FilterRole
- type FilterRoleUser
- type Group
- func (g Group) Check() error
- func (*Group) Descriptor() ([]byte, []int)
- func (this *Group) Equal(that interface{}) bool
- func (this *Group) GoString() string
- func (m *Group) Marshal() (dAtA []byte, err error)
- func (m *Group) MarshalTo(dAtA []byte) (int, error)
- func (m *Group) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Group) ProtoMessage()
- func (m *Group) Reset()
- func (m *Group) Size() (n int)
- func (this *Group) String() string
- func (m *Group) Unmarshal(dAtA []byte) error
- func (m *Group) XXX_DiscardUnknown()
- func (m *Group) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Group) XXX_Merge(src proto.Message)
- func (m *Group) XXX_Size() int
- func (m *Group) XXX_Unmarshal(b []byte) error
- type Invitation
- func (i Invitation) Check() error
- func (*Invitation) Descriptor() ([]byte, []int)
- func (this *Invitation) Equal(that interface{}) bool
- func (this *Invitation) GoString() string
- func (m *Invitation) Marshal() (dAtA []byte, err error)
- func (m *Invitation) MarshalTo(dAtA []byte) (int, error)
- func (m *Invitation) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Invitation) ProtoMessage()
- func (m *Invitation) Reset()
- func (m *Invitation) Size() (n int)
- func (this *Invitation) String() string
- func (m *Invitation) Unmarshal(dAtA []byte) error
- func (m *Invitation) XXX_DiscardUnknown()
- func (m *Invitation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Invitation) XXX_Merge(src proto.Message)
- func (m *Invitation) XXX_Size() int
- func (m *Invitation) XXX_Unmarshal(b []byte) error
- type InvitationRole
- func (*InvitationRole) Descriptor() ([]byte, []int)
- func (this *InvitationRole) Equal(that interface{}) bool
- func (this *InvitationRole) GoString() string
- func (m *InvitationRole) Marshal() (dAtA []byte, err error)
- func (m *InvitationRole) MarshalTo(dAtA []byte) (int, error)
- func (m *InvitationRole) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*InvitationRole) ProtoMessage()
- func (m *InvitationRole) Reset()
- func (m *InvitationRole) Size() (n int)
- func (this *InvitationRole) String() string
- func (m *InvitationRole) Unmarshal(dAtA []byte) error
- func (m *InvitationRole) XXX_DiscardUnknown()
- func (m *InvitationRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *InvitationRole) XXX_Merge(src proto.Message)
- func (m *InvitationRole) XXX_Size() int
- func (m *InvitationRole) XXX_Unmarshal(b []byte) error
- type Patch
- type PatchGroup
- type PatchInvitation
- type PatchRole
- type Permission
- func (*Permission) Descriptor() ([]byte, []int)
- func (this *Permission) Equal(that interface{}) bool
- func (this *Permission) GoString() string
- func (m *Permission) Marshal() (dAtA []byte, err error)
- func (m *Permission) MarshalTo(dAtA []byte) (int, error)
- func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Permission) ProtoMessage()
- func (m *Permission) Reset()
- func (m *Permission) Size() (n int)
- func (this *Permission) String() string
- func (m *Permission) Unmarshal(dAtA []byte) error
- func (m *Permission) XXX_DiscardUnknown()
- func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Permission) XXX_Merge(src proto.Message)
- func (m *Permission) XXX_Size() int
- func (m *Permission) XXX_Unmarshal(b []byte) error
- type Permissions
- type Requirement
- type Resource
- type Role
- func (r Role) Check() error
- func (*Role) Descriptor() ([]byte, []int)
- func (this *Role) Equal(that interface{}) bool
- func (this *Role) GoString() string
- func (m *Role) Marshal() (dAtA []byte, err error)
- func (m *Role) MarshalTo(dAtA []byte) (int, error)
- func (m *Role) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Role) ProtoMessage()
- func (m *Role) Reset()
- func (m *Role) Size() (n int)
- func (this *Role) String() string
- func (m *Role) Unmarshal(dAtA []byte) error
- func (m *Role) XXX_DiscardUnknown()
- func (m *Role) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Role) XXX_Merge(src proto.Message)
- func (m *Role) XXX_Size() int
- func (m *Role) XXX_Unmarshal(b []byte) error
- type RoleUser
- func (*RoleUser) Descriptor() ([]byte, []int)
- func (this *RoleUser) Equal(that interface{}) bool
- func (this *RoleUser) GoString() string
- func (m *RoleUser) Marshal() (dAtA []byte, err error)
- func (m *RoleUser) MarshalTo(dAtA []byte) (int, error)
- func (m *RoleUser) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*RoleUser) ProtoMessage()
- func (m *RoleUser) Reset()
- func (m *RoleUser) Size() (n int)
- func (this *RoleUser) String() string
- func (m *RoleUser) Unmarshal(dAtA []byte) error
- func (m *RoleUser) XXX_DiscardUnknown()
- func (m *RoleUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RoleUser) XXX_Merge(src proto.Message)
- func (m *RoleUser) XXX_Size() int
- func (m *RoleUser) XXX_Unmarshal(b []byte) error
- type Roles
- type Service
- type Store
- type StoreGroup
- type StoreInvitation
- type StoreInvitationRole
- type StorePermission
- type StoreRole
- type StoreRoleUser
- type U
- func (u U) Check(password string) error
- func (*U) Descriptor() ([]byte, []int)
- func (this *U) Equal(that interface{}) bool
- func (this *U) GoString() string
- func (m *U) Marshal() (dAtA []byte, err error)
- func (m *U) MarshalTo(dAtA []byte) (int, error)
- func (m *U) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*U) ProtoMessage()
- func (m *U) Reset()
- func (m *U) Size() (n int)
- func (this *U) String() string
- func (m *U) Unmarshal(dAtA []byte) error
- func (m *U) XXX_DiscardUnknown()
- func (m *U) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *U) XXX_Merge(src proto.Message)
- func (m *U) XXX_Size() int
- func (m *U) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthClaims = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowClaims = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupClaims = fmt.Errorf("proto: unexpected end of group") )
View Source
var ( ErrInvalidLengthGroup = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGroup = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGroup = fmt.Errorf("proto: unexpected end of group") )
View Source
var ( ErrInvalidLengthInvitation = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowInvitation = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupInvitation = fmt.Errorf("proto: unexpected end of group") )
View Source
var ( Resources = map[Resource]struct{}{ R_asset: {}, R_group: {}, R_operation: {}, R_role: {}, R_user: {}, } Commands = map[Command]struct{}{ C_read: {}, C_edit: {}, C_write: {}, } )
View Source
var ( ErrInvalidLengthRole = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRole = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupRole = fmt.Errorf("proto: unexpected end of group") )
View Source
var ( ErrInvalidLengthUser = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowUser = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupUser = fmt.Errorf("proto: unexpected end of group") )
View Source
var Command_name = map[int32]string{
0: "C_read",
1: "C_edit",
2: "C_write",
}
View Source
var Command_value = map[string]int32{
"C_read": 0,
"C_edit": 1,
"C_write": 2,
}
View Source
var Resource_name = map[int32]string{
0: "R_asset",
1: "R_group",
2: "R_operation",
3: "R_role",
4: "R_user",
}
View Source
var Resource_value = map[string]int32{
"R_asset": 0,
"R_group": 1,
"R_operation": 2,
"R_role": 3,
"R_user": 4,
}
Functions ¶
Types ¶
type ClaimAuth ¶
type ClaimAuth struct { // Groups key must be a group.ID Groups map[string]ClaimGroup `` /* 143-byte string literal not displayed */ }
func NewPopulatedClaimAuth ¶
func (*ClaimAuth) Descriptor ¶
func (*ClaimAuth) MarshalToSizedBuffer ¶
func (*ClaimAuth) ProtoMessage ¶
func (*ClaimAuth) ProtoMessage()
func (*ClaimAuth) XXX_DiscardUnknown ¶
func (m *ClaimAuth) XXX_DiscardUnknown()
func (*ClaimAuth) XXX_Marshal ¶
func (*ClaimAuth) XXX_Unmarshal ¶
type ClaimGroup ¶
type ClaimGroup struct { ID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"ID"` // Roles key must be a user.Role ID Roles map[string]pbtypes.Empty `` /* 141-byte string literal not displayed */ // Resources key must be a user.Resource Resources map[string]ClaimResources `` /* 149-byte string literal not displayed */ }
func NewPopulatedClaimGroup ¶
func NewPopulatedClaimGroup(r randyClaims, easy bool) *ClaimGroup
func (*ClaimGroup) Descriptor ¶
func (*ClaimGroup) Descriptor() ([]byte, []int)
func (*ClaimGroup) Equal ¶
func (this *ClaimGroup) Equal(that interface{}) bool
func (*ClaimGroup) GoString ¶
func (this *ClaimGroup) GoString() string
func (*ClaimGroup) Marshal ¶
func (m *ClaimGroup) Marshal() (dAtA []byte, err error)
func (*ClaimGroup) MarshalToSizedBuffer ¶
func (m *ClaimGroup) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ClaimGroup) ProtoMessage ¶
func (*ClaimGroup) ProtoMessage()
func (ClaimGroup) Require ¶
func (c ClaimGroup) Require(rs ...Requirement) error
func (*ClaimGroup) Reset ¶
func (m *ClaimGroup) Reset()
func (*ClaimGroup) Size ¶
func (m *ClaimGroup) Size() (n int)
func (*ClaimGroup) String ¶
func (this *ClaimGroup) String() string
func (*ClaimGroup) Unmarshal ¶
func (m *ClaimGroup) Unmarshal(dAtA []byte) error
func (*ClaimGroup) XXX_DiscardUnknown ¶
func (m *ClaimGroup) XXX_DiscardUnknown()
func (*ClaimGroup) XXX_Marshal ¶
func (m *ClaimGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ClaimGroup) XXX_Merge ¶
func (m *ClaimGroup) XXX_Merge(src proto.Message)
func (*ClaimGroup) XXX_Size ¶
func (m *ClaimGroup) XXX_Size() int
func (*ClaimGroup) XXX_Unmarshal ¶
func (m *ClaimGroup) XXX_Unmarshal(b []byte) error
type ClaimResources ¶
type ClaimResources struct { // Commands key must be a user.Commands Commands map[string]pbtypes.Empty `` /* 147-byte string literal not displayed */ }
func NewPopulatedClaimResources ¶
func NewPopulatedClaimResources(r randyClaims, easy bool) *ClaimResources
func (*ClaimResources) Descriptor ¶
func (*ClaimResources) Descriptor() ([]byte, []int)
func (*ClaimResources) Equal ¶
func (this *ClaimResources) Equal(that interface{}) bool
func (*ClaimResources) GoString ¶
func (this *ClaimResources) GoString() string
func (*ClaimResources) Marshal ¶
func (m *ClaimResources) Marshal() (dAtA []byte, err error)
func (*ClaimResources) MarshalToSizedBuffer ¶
func (m *ClaimResources) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ClaimResources) ProtoMessage ¶
func (*ClaimResources) ProtoMessage()
func (*ClaimResources) Reset ¶
func (m *ClaimResources) Reset()
func (*ClaimResources) Size ¶
func (m *ClaimResources) Size() (n int)
func (*ClaimResources) String ¶
func (this *ClaimResources) String() string
func (*ClaimResources) Unmarshal ¶
func (m *ClaimResources) Unmarshal(dAtA []byte) error
func (*ClaimResources) XXX_DiscardUnknown ¶
func (m *ClaimResources) XXX_DiscardUnknown()
func (*ClaimResources) XXX_Marshal ¶
func (m *ClaimResources) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ClaimResources) XXX_Merge ¶
func (m *ClaimResources) XXX_Merge(src proto.Message)
func (*ClaimResources) XXX_Size ¶
func (m *ClaimResources) XXX_Size() int
func (*ClaimResources) XXX_Unmarshal ¶
func (m *ClaimResources) XXX_Unmarshal(b []byte) error
type ErrEmptyEmail ¶
type ErrEmptyEmail struct{}
func (ErrEmptyEmail) Error ¶
func (e ErrEmptyEmail) Error() string
type ErrEmptyName ¶
type ErrEmptyName struct{}
func (ErrEmptyName) Error ¶
func (e ErrEmptyName) Error() string
type ErrEmptyPermissions ¶
type ErrEmptyPermissions struct{}
func (ErrEmptyPermissions) Error ¶
func (e ErrEmptyPermissions) Error() string
type ErrForbiddenAdminRole ¶
type ErrForbiddenAdminRole struct{}
func (ErrForbiddenAdminRole) Error ¶
func (e ErrForbiddenAdminRole) Error() string
type ErrInvalidClaims ¶
type ErrInvalidClaims struct {
Err error
}
func (ErrInvalidClaims) Error ¶
func (e ErrInvalidClaims) Error() string
type ErrInvalidEmailLength ¶
func (ErrInvalidEmailLength) Error ¶
func (e ErrInvalidEmailLength) Error() string
type ErrInvalidNameLength ¶
func (ErrInvalidNameLength) Error ¶
func (e ErrInvalidNameLength) Error() string
type ErrInvalidPassword ¶
type ErrInvalidPassword struct{}
func (ErrInvalidPassword) Error ¶
func (e ErrInvalidPassword) Error() string
type ErrUnauthorizedCommand ¶
type ErrUnauthorizedCommand struct {}
func (ErrUnauthorizedCommand) Error ¶
func (e ErrUnauthorizedCommand) Error() string
type ErrUnauthorizedResource ¶
type ErrUnauthorizedResource struct {
}func (ErrUnauthorizedResource) Error ¶
func (e ErrUnauthorizedResource) Error() string
type ErrUnauthorizedRole ¶
type ErrUnauthorizedRole struct {
}func (ErrUnauthorizedRole) Error ¶
func (e ErrUnauthorizedRole) Error() string
type ErrUnknownCommand ¶
type ErrUnknownCommand struct {
Command string
}
func (ErrUnknownCommand) Error ¶
func (e ErrUnknownCommand) Error() string
type ErrUnknownGroup ¶
type ErrUnknownGroup struct {
GroupID string
}
func (ErrUnknownGroup) Error ¶
func (e ErrUnknownGroup) Error() string
type ErrUnknownResource ¶
type ErrUnknownResource struct {
Resource string
}
func (ErrUnknownResource) Error ¶
func (e ErrUnknownResource) Error() string
type FilterGroup ¶
type FilterInvitation ¶
type FilterInvitationRole ¶
type FilterPermission ¶
type FilterRole ¶
type FilterRoleUser ¶
type Group ¶
type Group struct { ID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"ID"` Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` AvatarURL string `protobuf:"bytes,3,opt,name=AvatarURL,proto3" json:"AvatarURL,omitempty"` Description string `protobuf:"bytes,4,opt,name=Description,proto3" json:"Description,omitempty"` CreatedAt int64 `protobuf:"varint,5,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt int64 `protobuf:"varint,6,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` }
func NewPopulatedGroup ¶
func (*Group) Descriptor ¶
func (*Group) ProtoMessage ¶
func (*Group) ProtoMessage()
func (*Group) XXX_DiscardUnknown ¶
func (m *Group) XXX_DiscardUnknown()
func (*Group) XXX_Marshal ¶
func (*Group) XXX_Unmarshal ¶
type Invitation ¶
type Invitation struct { ID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"ID"` Email string `protobuf:"bytes,2,opt,name=Email,proto3" json:"Email,omitempty"` CreatedAt int64 `protobuf:"varint,3,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt int64 `protobuf:"varint,4,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` }
func NewPopulatedInvitation ¶
func NewPopulatedInvitation(r randyInvitation, easy bool) *Invitation
func (Invitation) Check ¶
func (i Invitation) Check() error
func (*Invitation) Descriptor ¶
func (*Invitation) Descriptor() ([]byte, []int)
func (*Invitation) Equal ¶
func (this *Invitation) Equal(that interface{}) bool
func (*Invitation) GoString ¶
func (this *Invitation) GoString() string
func (*Invitation) Marshal ¶
func (m *Invitation) Marshal() (dAtA []byte, err error)
func (*Invitation) MarshalToSizedBuffer ¶
func (m *Invitation) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Invitation) ProtoMessage ¶
func (*Invitation) ProtoMessage()
func (*Invitation) Reset ¶
func (m *Invitation) Reset()
func (*Invitation) Size ¶
func (m *Invitation) Size() (n int)
func (*Invitation) String ¶
func (this *Invitation) String() string
func (*Invitation) Unmarshal ¶
func (m *Invitation) Unmarshal(dAtA []byte) error
func (*Invitation) XXX_DiscardUnknown ¶
func (m *Invitation) XXX_DiscardUnknown()
func (*Invitation) XXX_Marshal ¶
func (m *Invitation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Invitation) XXX_Merge ¶
func (m *Invitation) XXX_Merge(src proto.Message)
func (*Invitation) XXX_Size ¶
func (m *Invitation) XXX_Size() int
func (*Invitation) XXX_Unmarshal ¶
func (m *Invitation) XXX_Unmarshal(b []byte) error
type InvitationRole ¶
type InvitationRole struct { InvitationID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,1,opt,name=InvitationID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"InvitationID"` RoleID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,2,opt,name=RoleID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"RoleID"` CreatedAt int64 `protobuf:"varint,3,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt int64 `protobuf:"varint,4,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` }
func NewPopulatedInvitationRole ¶
func NewPopulatedInvitationRole(r randyInvitation, easy bool) *InvitationRole
func (*InvitationRole) Descriptor ¶
func (*InvitationRole) Descriptor() ([]byte, []int)
func (*InvitationRole) Equal ¶
func (this *InvitationRole) Equal(that interface{}) bool
func (*InvitationRole) GoString ¶
func (this *InvitationRole) GoString() string
func (*InvitationRole) Marshal ¶
func (m *InvitationRole) Marshal() (dAtA []byte, err error)
func (*InvitationRole) MarshalToSizedBuffer ¶
func (m *InvitationRole) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*InvitationRole) ProtoMessage ¶
func (*InvitationRole) ProtoMessage()
func (*InvitationRole) Reset ¶
func (m *InvitationRole) Reset()
func (*InvitationRole) Size ¶
func (m *InvitationRole) Size() (n int)
func (*InvitationRole) String ¶
func (this *InvitationRole) String() string
func (*InvitationRole) Unmarshal ¶
func (m *InvitationRole) Unmarshal(dAtA []byte) error
func (*InvitationRole) XXX_DiscardUnknown ¶
func (m *InvitationRole) XXX_DiscardUnknown()
func (*InvitationRole) XXX_Marshal ¶
func (m *InvitationRole) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*InvitationRole) XXX_Merge ¶
func (m *InvitationRole) XXX_Merge(src proto.Message)
func (*InvitationRole) XXX_Size ¶
func (m *InvitationRole) XXX_Size() int
func (*InvitationRole) XXX_Unmarshal ¶
func (m *InvitationRole) XXX_Unmarshal(b []byte) error
type PatchGroup ¶
type PatchInvitation ¶
type Permission ¶
type Permission struct { RoleID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,1,opt,name=RoleID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"RoleID"` Resource Resource `protobuf:"varint,2,opt,name=Resource,proto3,enum=user.Resource" json:"Resource,omitempty"` Command Command `protobuf:"varint,3,opt,name=Command,proto3,enum=user.Command" json:"Command,omitempty"` CreatedAt int64 `protobuf:"varint,4,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt int64 `protobuf:"varint,5,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` }
func AllPermissions ¶
func AllPermissions(roleID ulid.ID) []Permission
func NewPopulatedPermission ¶
func NewPopulatedPermission(r randyRole, easy bool) *Permission
func (*Permission) Descriptor ¶
func (*Permission) Descriptor() ([]byte, []int)
func (*Permission) Equal ¶
func (this *Permission) Equal(that interface{}) bool
func (*Permission) GoString ¶
func (this *Permission) GoString() string
func (*Permission) Marshal ¶
func (m *Permission) Marshal() (dAtA []byte, err error)
func (*Permission) MarshalToSizedBuffer ¶
func (m *Permission) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Permission) ProtoMessage ¶
func (*Permission) ProtoMessage()
func (*Permission) Reset ¶
func (m *Permission) Reset()
func (*Permission) Size ¶
func (m *Permission) Size() (n int)
func (*Permission) String ¶
func (this *Permission) String() string
func (*Permission) Unmarshal ¶
func (m *Permission) Unmarshal(dAtA []byte) error
func (*Permission) XXX_DiscardUnknown ¶
func (m *Permission) XXX_DiscardUnknown()
func (*Permission) XXX_Marshal ¶
func (m *Permission) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Permission) XXX_Merge ¶
func (m *Permission) XXX_Merge(src proto.Message)
func (*Permission) XXX_Size ¶
func (m *Permission) XXX_Size() int
func (*Permission) XXX_Unmarshal ¶
func (m *Permission) XXX_Unmarshal(b []byte) error
type Permissions ¶
type Permissions []Permission
func (Permissions) ByRole ¶
func (ps Permissions) ByRole() map[string][]Permission
func (Permissions) Check ¶
func (ps Permissions) Check() error
type Requirement ¶
func NewRequirements ¶
func NewRequirements(groupIDs []ulid.ID, resource Resource, command Command) []Requirement
type Role ¶
type Role struct { ID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"ID"` GroupID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,2,opt,name=GroupID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"GroupID"` Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"` CreatedAt int64 `protobuf:"varint,4,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt int64 `protobuf:"varint,5,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` }
func NewPopulatedRole ¶
func (*Role) Descriptor ¶
func (*Role) ProtoMessage ¶
func (*Role) ProtoMessage()
func (*Role) XXX_DiscardUnknown ¶
func (m *Role) XXX_DiscardUnknown()
func (*Role) XXX_Unmarshal ¶
type RoleUser ¶
type RoleUser struct { RoleID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,1,opt,name=RoleID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"RoleID"` UserID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,2,opt,name=UserID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"UserID"` CreatedAt int64 `protobuf:"varint,3,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt int64 `protobuf:"varint,4,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` }
func NewPopulatedRoleUser ¶
func (*RoleUser) Descriptor ¶
func (*RoleUser) MarshalToSizedBuffer ¶
func (*RoleUser) ProtoMessage ¶
func (*RoleUser) ProtoMessage()
func (*RoleUser) XXX_DiscardUnknown ¶
func (m *RoleUser) XXX_DiscardUnknown()
func (*RoleUser) XXX_Marshal ¶
func (*RoleUser) XXX_Unmarshal ¶
type Service ¶
type Service interface { transaction.Transactioner Store StoreGroup StoreRole StorePermission StoreRoleUser StoreInvitation StoreInvitationRole CreateJWT(context.Context, U, string, time.Duration) (string, error) ReadJWT(context.Context, string) (Claims, error) Auth(context.Context, string) (Claims, error) }
type Store ¶
type Store interface { Insert(context.Context, U) error InsertBatch(context.Context, ...U) error Fetch(context.Context, Filter) (U, error) List(context.Context, Filter) ([]U, uint64, error) Update(context.Context, Filter, Patch) ([]U, error) Delete(context.Context, Filter) error FetchWithPassword(context.Context, Filter) (U, error) ListByGroup(context.Context, Filter) (map[string][]U, uint64, error) ListByRole(context.Context, Filter) (map[string][]U, uint64, error) CountByGroup(context.Context, Filter) (map[string]uint64, error) }
type StoreGroup ¶
type StoreGroup interface { InsertGroup(context.Context, Group) error InsertBatchGroup(context.Context, ...Group) error UpdateGroup(context.Context, FilterGroup, PatchGroup) ([]Group, error) FetchGroup(context.Context, FilterGroup) (Group, error) ListGroup(context.Context, FilterGroup) ([]Group, uint64, error) DeleteGroup(context.Context, FilterGroup) ([]Group, error) }
type StoreInvitation ¶
type StoreInvitation interface { InsertInvitation(context.Context, Invitation) error InsertBatchInvitation(context.Context, ...Invitation) error UpdateInvitation(context.Context, FilterInvitation, PatchInvitation) ([]Invitation, error) FetchInvitation(context.Context, FilterInvitation) (Invitation, error) ListInvitation(context.Context, FilterInvitation) ([]Invitation, uint64, error) ListInvitationByGroup(context.Context, FilterInvitation) (map[string][]Invitation, uint64, error) DeleteInvitation(context.Context, FilterInvitation) error }
type StoreInvitationRole ¶
type StoreInvitationRole interface { InsertInvitationRole(context.Context, InvitationRole) error InsertBatchInvitationRole(context.Context, ...InvitationRole) error FetchInvitationRole(context.Context, FilterInvitationRole) (InvitationRole, error) ListInvitationRole(context.Context, FilterInvitationRole) ([]InvitationRole, error) CountInvitationRoleByInvitation(context.Context, FilterInvitationRole) (map[string]uint64, error) DeleteInvitationRole(context.Context, FilterInvitationRole) error DeleteInvitationRoleByGroup(context.Context, FilterInvitationRole) error }
type StorePermission ¶
type StorePermission interface { InsertPermission(context.Context, Permission) error InsertBatchPermission(context.Context, ...Permission) error FetchPermission(context.Context, FilterPermission) (Permission, error) ListPermission(context.Context, FilterPermission) ([]Permission, error) DeletePermission(context.Context, FilterPermission) error }
type StoreRole ¶
type StoreRole interface { InsertRole(context.Context, Role) error InsertBatchRole(context.Context, ...Role) error UpdateRole(context.Context, FilterRole, PatchRole) ([]Role, error) FetchRole(context.Context, FilterRole) (Role, error) ListRole(context.Context, FilterRole) ([]Role, uint64, error) ListRoleByInvitation(context.Context, FilterRole) (map[string][]Role, uint64, error) DeleteRole(context.Context, FilterRole) error CountRoleByGroup(context.Context, FilterRole) (map[string]uint64, error) }
type StoreRoleUser ¶
type StoreRoleUser interface { InsertRoleUser(context.Context, RoleUser) error InsertBatchRoleUser(context.Context, ...RoleUser) error FetchRoleUser(context.Context, FilterRoleUser) (RoleUser, error) ListRoleUser(context.Context, FilterRoleUser) ([]RoleUser, error) DeleteRoleUser(context.Context, FilterRoleUser) error ListClaims(context.Context, ulid.ID) (ClaimAuth, error) }
type U ¶
type U struct { ID github_com_elojah_trax_pkg_ulid.ID `protobuf:"bytes,1,opt,name=ID,proto3,customtype=github.com/elojah/trax/pkg/ulid.ID" json:"ID"` Email string `protobuf:"bytes,2,opt,name=Email,proto3" json:"Email,omitempty"` PasswordHash []byte `protobuf:"bytes,3,opt,name=PasswordHash,proto3" json:"PasswordHash,omitempty"` PasswordSalt []byte `protobuf:"bytes,4,opt,name=PasswordSalt,proto3" json:"PasswordSalt,omitempty"` GoogleID string `protobuf:"bytes,5,opt,name=GoogleID,proto3" json:"GoogleID,omitempty"` FirstName string `protobuf:"bytes,6,opt,name=FirstName,proto3" json:"FirstName,omitempty"` LastName string `protobuf:"bytes,7,opt,name=LastName,proto3" json:"LastName,omitempty"` AvatarURL string `protobuf:"bytes,8,opt,name=AvatarURL,proto3" json:"AvatarURL,omitempty"` CreatedAt int64 `protobuf:"varint,9,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` UpdatedAt int64 `protobuf:"varint,10,opt,name=UpdatedAt,proto3" json:"UpdatedAt,omitempty"` }
func NewPopulatedU ¶
func (*U) Descriptor ¶
func (*U) ProtoMessage ¶
func (*U) ProtoMessage()
func (*U) XXX_DiscardUnknown ¶
func (m *U) XXX_DiscardUnknown()
func (*U) XXX_Unmarshal ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.