mfile

package
v0.0.0-...-36d6306 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDEquals

func IDEquals(id, other idwrap.IDWrap) bool

IDEquals checks if two IDWrap values are equal

func IDIsZero

func IDIsZero(id idwrap.IDWrap) bool

IDIsZero checks if the IDWrap is zero/empty

func IsValidContentType

func IsValidContentType(kind ContentType) bool

IsValidContentType checks if the content type is valid

Types

type ContentType

type ContentType int8

ContentType represents the type of content stored in a file

const (
	ContentTypeUnknown      ContentType = -1
	ContentTypeFolder       ContentType = 0 // folder
	ContentTypeHTTP         ContentType = 1 // http
	ContentTypeHTTPDelta    ContentType = 2 // http delta (draft/overlay)
	ContentTypeFlow         ContentType = 3 // flow
	ContentTypeCredential   ContentType = 4 // credential
	ContentTypeGraphQL      ContentType = 5 // graphql
	ContentTypeWebSocket    ContentType = 6 // websocket
	ContentTypeGraphQLDelta ContentType = 7 // graphql delta (draft/overlay)
)

func ContentTypeFromString

func ContentTypeFromString(s string) ContentType

ContentTypeFromString converts a string to ContentType

func (ContentType) String

func (ct ContentType) String() string

String returns the string representation of ContentType

type File

type File struct {
	ID          idwrap.IDWrap
	WorkspaceID idwrap.IDWrap
	ParentID    *idwrap.IDWrap // Optional parent folder
	ContentID   *idwrap.IDWrap // References content (can be nil for empty placeholders)
	ContentType ContentType    // Type of content
	Name        string
	Order       float64
	PathHash    *string
	UpdatedAt   time.Time
}

File represents a file in the unified file system Uses simple pointer approach - just metadata + content reference

func (File) GetCreatedTime

func (f File) GetCreatedTime() time.Time

GetCreatedTime returns the creation time from the ULID

func (File) GetCreatedTimeUnix

func (f File) GetCreatedTimeUnix() int64

GetCreatedTimeUnix returns the creation time as Unix milliseconds

func (File) HasContent

func (f File) HasContent() bool

HasContent returns true if the file has associated content

func (File) IsCredential

func (f File) IsCredential() bool

IsCredential returns true if the file contains a credential

func (File) IsFlow

func (f File) IsFlow() bool

IsFlow returns true if the file contains a flow

func (File) IsFolder

func (f File) IsFolder() bool

IsFolder returns true if the file is a folder

func (File) IsGraphQL

func (f File) IsGraphQL() bool

IsGraphQL returns true if the file contains a GraphQL request

func (File) IsGraphQLDelta

func (f File) IsGraphQLDelta() bool

IsGraphQLDelta returns true if the file contains a GraphQL delta request

func (File) IsHTTP

func (f File) IsHTTP() bool

IsHTTP returns true if the file contains an HTTP request

func (File) IsHTTPDelta

func (f File) IsHTTPDelta() bool

IsHTTPDelta returns true if the file contains an HTTP delta request

func (File) IsRoot

func (f File) IsRoot() bool

IsRoot returns true if the file has no parent folder

func (File) IsWebSocket

func (f File) IsWebSocket() bool

IsWebSocket returns true if the file contains a WebSocket connection

func (File) Validate

func (f File) Validate() error

Validate performs basic validation on the file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL