Documentation ¶
Index ¶
- Constants
- func NewPermissions(userId int32, perm cert.Permission) *proto.Permissions
- func NewProtoFile(file *File) *proto.File
- type CertificateApplication
- type Ctrl
- type DirectoryApplication
- type EventBus
- type File
- func (file *File) AddMetadata(key string, value string) (old string, exists bool)
- func (file *File) AddPermission(uid int32, perm cert.Permission)
- func (file *File) Data() []byte
- func (file *File) Directory() string
- func (file *File) Flags() Flag
- func (file *File) Id() string
- func (file *File) IsContributor(uid int32) bool
- func (file *File) MarkAsProtected()
- func (file *File) Metadata() Metadata
- func (file *File) Name() string
- func (file *File) Owners() []int32
- func (file *File) Permission(uid int32) (perm cert.Permission)
- func (file *File) ProtectFields(uid int32)
- func (file *File) RevokeAccess(uid int32) bool
- func (file *File) RevokePermission(uid int32, perm cert.Permission)
- func (file *File) SetDirectory(dir string)
- func (file *File) SetFlag(flag Flag)
- func (file *File) SetID(id string)
- func (file *File) SetName(name string)
- func (file *File) SharedWith() []int32
- func (file *File) Value(key string) (value string, exists bool)
- type FileApplication
- func (app *FileApplication) Create(ctx context.Context, uid int32, fpath string, data []byte, meta Metadata) (*File, error)
- func (app *FileApplication) Delete(ctx context.Context, uid int32, fid string) (*File, error)
- func (app *FileApplication) Get(ctx context.Context, uid int32, fid string) (*File, error)
- func (app *FileApplication) Update(ctx context.Context, uid int32, fid string, name string, data []byte, ...) (*File, error)
- type FileEventBus
- type FileEventHandler
- type FileEventPayload
- type FileGrpcService
- func (server *FileGrpcService) Create(ctx context.Context, req *proto.File) (*proto.File, error)
- func (server *FileGrpcService) Delete(ctx context.Context, req *proto.File) (*proto.File, error)
- func (server *FileGrpcService) Get(ctx context.Context, req *proto.File) (*proto.File, error)
- func (server *FileGrpcService) Update(ctx context.Context, req *proto.File) (*proto.File, error)
- type FileRepository
- type Flag
- type Metadata
- type MongoFileRepository
- func (repo *MongoFileRepository) Create(ctx context.Context, file *File) error
- func (repo *MongoFileRepository) Delete(ctx context.Context, file *File) error
- func (repo *MongoFileRepository) Find(ctx context.Context, id string) (*File, error)
- func (repo *MongoFileRepository) FindAll(ctx context.Context, ids []string) ([]*File, error)
- func (repo *MongoFileRepository) Save(ctx context.Context, file *File) error
Constants ¶
View Source
const ( Directory Flag = 0x01 FilenameRegex string = "^[^/]+$" MetadataCreatedAtKey = "created_at" MetadataUpdatedAtKey = "updated_at" MetadataDeletedAtKey = "deleted_at" MetadataSizeKey = "size" MetadataAppKey = "app" MetadataRefKey = "ref" TimestampBase = 16 )
View Source
const (
MongoFileCollectionName = "files"
)
Variables ¶
This section is empty.
Functions ¶
func NewPermissions ¶
func NewPermissions(userId int32, perm cert.Permission) *proto.Permissions
func NewProtoFile ¶
Types ¶
type CertificateApplication ¶
type DirectoryApplication ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
func (*File) AddMetadata ¶
func (*File) AddPermission ¶
func (file *File) AddPermission(uid int32, perm cert.Permission)
func (*File) IsContributor ¶
func (*File) MarkAsProtected ¶
func (file *File) MarkAsProtected()
func (*File) Permission ¶
func (file *File) Permission(uid int32) (perm cert.Permission)
func (*File) ProtectFields ¶
ProtectFields clear from the file all those fields the given user has no permissions to read.
func (*File) RevokeAccess ¶
func (*File) RevokePermission ¶
func (file *File) RevokePermission(uid int32, perm cert.Permission)
func (*File) SetDirectory ¶
func (*File) SharedWith ¶
type FileApplication ¶
type FileApplication struct {
// contains filtered or unexported fields
}
func NewFileApplication ¶
func NewFileApplication(repo FileRepository, dirApp DirectoryApplication, certApp CertificateApplication, logger *zap.Logger) *FileApplication
type FileEventBus ¶
type FileEventBus struct { *fb.RabbitMqEventBus // contains filtered or unexported fields }
func NewFileEventBus ¶
func NewFileEventBus(bus *fb.RabbitMqEventBus, exchange string, issuer string) *FileEventBus
func (*FileEventBus) EmitFileCreated ¶
func (bus *FileEventBus) EmitFileCreated(uid int32, f *File) error
func (*FileEventBus) EmitFileDeleted ¶
func (bus *FileEventBus) EmitFileDeleted(uid int32, f *File) error
type FileEventHandler ¶
type FileEventHandler struct {
// contains filtered or unexported fields
}
func NewFileEventHandler ¶
func NewFileEventHandler(fileApp *FileApplication, certApp *cert.CertificateApplication, logger *zap.Logger) *FileEventHandler
func (*FileEventHandler) DiscardIssuer ¶
func (handler *FileEventHandler) DiscardIssuer(issuer string)
type FileEventPayload ¶
type FileGrpcService ¶
type FileGrpcService struct { proto.UnimplementedFileServiceServer // contains filtered or unexported fields }
func NewFileGrpcServer ¶
func NewFileGrpcServer(fileApp *FileApplication, certApp *cert.CertificateApplication, bus EventBus, authHeader string, logger *zap.Logger) *FileGrpcService
type FileRepository ¶
type MongoFileRepository ¶
type MongoFileRepository struct {
// contains filtered or unexported fields
}
func NewMongoFileRepository ¶
func NewMongoFileRepository(db *mongo.Database, logger *zap.Logger) *MongoFileRepository
func (*MongoFileRepository) Create ¶
func (repo *MongoFileRepository) Create(ctx context.Context, file *File) error
func (*MongoFileRepository) Delete ¶
func (repo *MongoFileRepository) Delete(ctx context.Context, file *File) error
Click to show internal directories.
Click to hide internal directories.