Documentation
¶
Index ¶
Constants ¶
View Source
const ( DenyReasonReadonlyPhaseDenied = "readonly_phase_denied" DenyReasonPermissionDenied = "permission_denied" DenyReasonPathBoundary = "path_boundary_violation" )
Variables ¶
View Source
var ( ErrPermissionDenied = errors.New(DenyReasonPermissionDenied) ErrPathBoundary = errors.New(DenyReasonPathBoundary) ErrReadonlyPhaseDenied = errors.New(DenyReasonReadonlyPhaseDenied) )
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authorizer ¶
type Config ¶
type Config struct {
MinDialect Dialect
MaxDialect Dialect
RolloutPhase RolloutPhase
}
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewEngine ¶
func NewEngine(cfg Config, auth Authenticator, authz Authorizer, fs FileSystem, telemetry Telemetry) (*Engine, error)
func (*Engine) IsReadOnly ¶
func (*Engine) Phase ¶
func (e *Engine) Phase() RolloutPhase
type FileSystem ¶
type FileSystem interface {
Stat(ctx context.Context, principal, virtualPath string) (DirEntry, error)
List(ctx context.Context, principal, virtualPath string) ([]DirEntry, error)
Read(ctx context.Context, principal, virtualPath string, offset, limit int64) ([]byte, error)
CreateOrTruncate(ctx context.Context, principal, virtualPath string) (DirEntry, error)
Write(ctx context.Context, principal, virtualPath string, offset int64, data []byte) (int64, error)
Mkdir(ctx context.Context, principal, virtualPath string) (DirEntry, error)
Rename(ctx context.Context, principal, fromPath, toPath string) error
Delete(ctx context.Context, principal, virtualPath string, isDir bool) error
}
type Permission ¶
type Permission string
const ( PermissionRead Permission = "read" PermissionWrite Permission = "write" PermissionManage Permission = "manage" )
type RolloutPhase ¶
type RolloutPhase string
const ( RolloutPhaseReadOnly RolloutPhase = "readonly" RolloutPhaseWriteSafe RolloutPhase = "write-safe" RolloutPhaseWriteFull RolloutPhase = "write-full" )
Click to show internal directories.
Click to hide internal directories.