Documentation
¶
Index ¶
- Constants
- func AppendNoteBody(existing, addition string) string
- func ArtifactKey(artifactID string) string
- func ArtifactSourceURL(artifact Artifact) string
- func ContextWithUserID(ctx context.Context, userID string) context.Context
- func NoteURL(root, key string) string
- func ObjectForURL(url string) storage.Object
- func Provider(options ...storage.Option) (storage.Manager, error)
- func Register(opts ...Option)
- func ResolveRootURI(template, userID, basePath string, macros map[string]string) (string, string, error)
- func SanitizePathComponent(value string) string
- func UserIDFromContext(ctx context.Context) string
- type AppendInput
- type AppendOutput
- type Artifact
- type Config
- type Entry
- type FetchInput
- type FetchOutput
- type ListInput
- type ListOutput
- type MemorizeInput
- type MemorizeOutput
- type Note
- type Option
- func WithAFS(fs afs.Service) Option
- func WithAllowedTargetSchemes(schemes ...string) Option
- func WithBasePath(basePath string) Option
- func WithConfig(config Config) Option
- func WithMacros(macros map[string]string) Option
- func WithNow(now func() time.Time) Option
- func WithRootURI(template string) Option
- func WithUserID(userID string) Option
- func WithUserIDProvider(provider UserIDProvider) Option
- type Service
- func (s *Service) Append(ctx context.Context, input *AppendInput) (*AppendOutput, error)
- func (s *Service) Delete(ctx context.Context, key string) error
- func (s *Service) Fetch(ctx context.Context, key string) (*FetchOutput, error)
- func (s *Service) FetchArtifact(ctx context.Context, artifactID string) (*Artifact, error)
- func (s *Service) List(ctx context.Context) (*ListOutput, error)
- func (s *Service) Memorize(ctx context.Context, input *MemorizeInput) (*MemorizeOutput, error)
- func (s *Service) OpenArtifact(ctx context.Context, artifactID string) (*Artifact, io.ReadCloser, error)
- func (s *Service) ResolveRootURI() (string, string, error)
- func (s *Service) ResolveRootURIContext(ctx context.Context) (string, string, error)
- type UserIDProvider
Constants ¶
View Source
const ( Scheme = "scratchpad" DefaultRootURITemplate = "mem://localhost/scratchpad/${userID}" )
Variables ¶
This section is empty.
Functions ¶
func AppendNoteBody ¶
func ArtifactKey ¶
func ArtifactSourceURL ¶
func ObjectForURL ¶
func ResolveRootURI ¶
func SanitizePathComponent ¶
func UserIDFromContext ¶
Types ¶
type AppendInput ¶
type AppendOutput ¶
type FetchInput ¶
type FetchInput struct {
Key string `json:"key" description:"Exact scratchpad key to fetch."`
}
type FetchOutput ¶
type ListOutput ¶
type MemorizeInput ¶
type MemorizeOutput ¶
type Option ¶
type Option func(*Config)
func WithBasePath ¶
func WithConfig ¶
func WithMacros ¶
func WithRootURI ¶
func WithUserID ¶
func WithUserIDProvider ¶
func WithUserIDProvider(provider UserIDProvider) Option
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) Append ¶
func (s *Service) Append(ctx context.Context, input *AppendInput) (*AppendOutput, error)
func (*Service) FetchArtifact ¶
func (*Service) Memorize ¶
func (s *Service) Memorize(ctx context.Context, input *MemorizeInput) (*MemorizeOutput, error)
func (*Service) OpenArtifact ¶
type UserIDProvider ¶
Click to show internal directories.
Click to hide internal directories.