au

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDirEnvironmentVariable    = "AU_DIRECTORY"
	WorkspaceUidEnvironmentVariable = "AU_WORKSPACE"
	AuthorEnvironmentVariable       = "AU_AUTHOR"
	EditorVariable                  = "AU_EDITOR"
	GlobalEditorVariable            = "EDITOR"
	DefaultConfigDir                = "$HOME/.au"
)
View Source
const AurelianRankAnnotation = "https://" + ReservedAnnotationHostname + "/annotations/rank"
View Source
const DefaultCommentMediaType = "text/markdown"
View Source
const MaximumAliasLength = 100
View Source
const MaximumDescriptionLength = 5000
View Source
const MaximumTodoTitleLength = 200
View Source
const MinimumAliasLength = 3
View Source
const MinimumTodoTitleLength = 3
View Source
const ReservedAnnotationHostname = "aurelian.one"
View Source
const ReservedAnnotationShortHostname = "aurelian"
View Source
const Suffix = ".automerge"

Variables

View Source
var Commit = "unknown"
View Source
var CommitTimestamp = "0"
View Source
var ErrContainsInvalidUtf8Runes = errors.New("contains invalid utf8 runes")
View Source
var ErrDisallowedCharacter = errors.New("disallowed rune")
View Source
var Version = "unknown"

Functions

func NewInMemoryWorkspaceProvider added in v0.0.9

func NewInMemoryWorkspaceProvider(doc *automerge.Doc) *inMemoryWorkspaceProvider

func ResolveAuthor added in v0.0.8

func ResolveAuthor(flagValue string) (string, error)

func ResolveConfigDirectory

func ResolveConfigDirectory(flagValue string) (string, error)

func ResolveWorkspaceUid

func ResolveWorkspaceUid(flagValue string) (string, error)

func ValidateAndCleanUnicode added in v0.0.8

func ValidateAndCleanUnicode(input string, allowMultiline bool) (output string, err error)

func ValidateTodoAnnotationKey added in v0.0.8

func ValidateTodoAnnotationKey(key string) error

func ValidateTodoDescription added in v0.0.8

func ValidateTodoDescription(input string) (string, error)

func ValidateTodoStatus added in v0.0.8

func ValidateTodoStatus(input string) (string, error)

func ValidateTodoTitle added in v0.0.8

func ValidateTodoTitle(input string) (string, error)

func ValidateWorkspaceAlias added in v0.0.8

func ValidateWorkspaceAlias(input string) (string, error)

func ValidatedAuthor added in v0.0.8

func ValidatedAuthor(input string) error

Types

type Comment added in v0.0.8

type Comment struct {
	Id        string
	CreatedAt time.Time
	CreatedBy string
	UpdatedAt *time.Time
	UpdatedBy *string
	MediaType string
	Content   []byte
}

type CreateCommentParams added in v0.0.8

type CreateCommentParams struct {
	MediaType string
	Content   []byte
	CreatedBy string
}

type CreateTodoParams added in v0.0.7

type CreateTodoParams struct {
	Title       string
	Description string
	Status      *string
	Annotations map[string]string
	CreatedBy   string
}

type CreateWorkspaceParams added in v0.0.7

type CreateWorkspaceParams struct {
	Alias string
}

type DeleteCommentParams added in v0.0.9

type DeleteCommentParams struct {
	DeletedBy string
}

type DeleteTodoParams added in v0.0.9

type DeleteTodoParams struct {
	DeletedBy string
}

type DocProvider added in v0.0.7

type DocProvider interface {
	GetDoc() *automerge.Doc
}

type EditCommentParams added in v0.0.8

type EditCommentParams struct {
	Content   []byte
	UpdatedBy string
}

type EditTodoParams added in v0.0.7

type EditTodoParams struct {
	Title       *string
	Description *string
	Status      *string
	Annotations map[string]string
	UpdatedBy   string
}

type StorageProvider added in v0.0.7

type StorageProvider interface {
	ListWorkspaces(ctx context.Context) ([]WorkspaceMeta, error)
	GetWorkspace(ctx context.Context, id string) (*WorkspaceMeta, error)
	CreateWorkspace(ctx context.Context, params CreateWorkspaceParams) (*WorkspaceMeta, error)
	DeleteWorkspace(ctx context.Context, id string) error
	ImportWorkspace(ctx context.Context, id string, data []byte) (*WorkspaceMeta, error)

	GetCurrentWorkspace(ctx context.Context) (string, error)
	SetCurrentWorkspace(ctx context.Context, id string) error
	SetCurrentAuthor(ctx context.Context, author string) error

	OpenWorkspace(ctx context.Context, id string, writeable bool) (WorkspaceProvider, error)
}

func NewDirectoryStorage added in v0.0.7

func NewDirectoryStorage(path string) (StorageProvider, error)

type Todo added in v0.0.7

type Todo struct {
	Id           string
	CreatedAt    time.Time
	CreatedBy    string
	UpdatedAt    *time.Time
	UpdatedBy    *string
	CommentCount int

	Title       string
	Description string
	Status      string
	Annotations map[string]string
}

type WorkspaceMeta added in v0.0.7

type WorkspaceMeta struct {
	Id            string
	Alias         string
	CreatedAt     time.Time
	SizeBytes     int64
	CurrentAuthor *string
}

type WorkspaceProvider added in v0.0.7

type WorkspaceProvider interface {
	Metadata() WorkspaceMeta

	ListTodos(ctx context.Context) ([]Todo, error)
	GetTodo(ctx context.Context, id string) (*Todo, error)
	CreateTodo(ctx context.Context, params CreateTodoParams) (*Todo, error)
	EditTodo(ctx context.Context, id string, params EditTodoParams) (*Todo, error)
	DeleteTodo(ctx context.Context, id string, params DeleteTodoParams) error

	ListComments(ctx context.Context, todoId string) ([]Comment, error)
	GetComment(ctx context.Context, todoId, commentId string) (*Comment, error)
	CreateComment(ctx context.Context, todoId string, params CreateCommentParams) (*Comment, error)
	EditComment(ctx context.Context, todoId, commentId string, params EditCommentParams) (*Comment, error)
	DeleteComment(ctx context.Context, todoId, commentId string, params DeleteCommentParams) error

	Flush() error
	Close() error
}

Jump to

Keyboard shortcuts

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