client

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Overview

filepath: /home/epheo/dev/anytype-go/pkg/anytype/client/auth.go

Package client implements the client interfaces defined in the anytype package

Package client implements the client interfaces defined in the anytype package

Index

Constants

This section is empty.

Variables

View Source
var ErrTypeNotFound = errors.New("type not found")

Functions

func NewClient

func NewClient(options anytype.ClientOptions) anytype.Client

NewClient creates a new Anytype API client with the given options

Types

type AuthClientImpl

type AuthClientImpl struct {
	// contains filtered or unexported fields
}

AuthClientImpl implements the AuthClient interface

func (*AuthClientImpl) DisplayCode

func (ac *AuthClientImpl) DisplayCode(ctx context.Context, appName string) (*anytype.DisplayCodeResponse, error)

DisplayCode initiates a secure authentication flow

func (*AuthClientImpl) GetToken

func (ac *AuthClientImpl) GetToken(ctx context.Context, challengeID string, code string) (*anytype.TokenResponse, error)

GetToken completes the authentication flow by providing a code

type BlockClientImpl

type BlockClientImpl struct {
	// contains filtered or unexported fields
}

BlockClientImpl implements the BlockClient interface

func (*BlockClientImpl) Create

Create creates a new block in the object

func (*BlockClientImpl) Delete

func (bc *BlockClientImpl) Delete(ctx context.Context, blockID string) error

Delete deletes a block from the object

func (*BlockClientImpl) Get

func (bc *BlockClientImpl) Get(ctx context.Context, blockID string) (*anytype.Block, error)

Get retrieves a specific block by ID

func (*BlockClientImpl) List

func (bc *BlockClientImpl) List(ctx context.Context) ([]anytype.Block, error)

List returns all blocks in the object

func (*BlockClientImpl) Update

func (bc *BlockClientImpl) Update(ctx context.Context, blockID string, request anytype.UpdateBlockRequest) error

Update updates a block in the object

type ClientImpl

type ClientImpl struct {
	// contains filtered or unexported fields
}

ClientImpl is the actual implementation of the Client interface

func (*ClientImpl) Auth

func (c *ClientImpl) Auth() anytype.AuthClient

Auth returns an AuthClient for authentication operations

func (*ClientImpl) Search

func (c *ClientImpl) Search() anytype.SearchClient

Search returns a SearchClient for global search operations

func (*ClientImpl) Space

func (c *ClientImpl) Space(spaceID string) anytype.SpaceContext

Space returns a SpaceContext for working with a specific space

func (*ClientImpl) Spaces

func (c *ClientImpl) Spaces() anytype.SpaceClient

Spaces returns a SpaceClient for working with spaces

type ListClientImpl

type ListClientImpl struct {
	// contains filtered or unexported fields
}

ListClientImpl implements the ListClient interface

func (*ListClientImpl) Add

func (lc *ListClientImpl) Add(ctx context.Context, objectIDs []string) error

Add is used for adding objects to any list

func (*ListClientImpl) AddObjects

func (lc *ListClientImpl) AddObjects(ctx context.Context, listID string, objectIDs []string) error

AddObjects adds objects to a list

func (*ListClientImpl) GetObjects

func (lc *ListClientImpl) GetObjects(ctx context.Context, listID string, viewID string) ([]anytype.Object, error)

GetObjects retrieves objects for a specific list view

func (*ListClientImpl) GetViews

func (lc *ListClientImpl) GetViews(ctx context.Context, listID string) ([]anytype.ListView, error)

GetViews retrieves views for a specific list

func (*ListClientImpl) RemoveObject

func (lc *ListClientImpl) RemoveObject(ctx context.Context, listID string, objectID string) error

RemoveObject removes an object from a list

type ListContextImpl

type ListContextImpl struct {
	// contains filtered or unexported fields
}

ListContextImpl implements the ListContext interface

func (*ListContextImpl) Object

func (lc *ListContextImpl) Object(objectID string) anytype.ObjectListContext

Object returns an ObjectListContext for a specific object in this list

func (*ListContextImpl) Objects

Objects returns an ObjectListClient for this list

func (*ListContextImpl) View

func (lc *ListContextImpl) View(viewID string) anytype.ViewContext

View returns a ViewContext for a specific view in this list

func (*ListContextImpl) Views

func (lc *ListContextImpl) Views() anytype.ViewClient

Views returns a ViewClient for this list

type MemberClientImpl

type MemberClientImpl struct {
	// contains filtered or unexported fields
}

MemberClientImpl implements the MemberClient interface

func (*MemberClientImpl) List

List returns all members in the space

type MemberContextImpl

type MemberContextImpl struct {
	// contains filtered or unexported fields
}

MemberContextImpl implements the MemberContext interface

func (*MemberContextImpl) Get

Get retrieves details about this member

type ObjectClientImpl

type ObjectClientImpl struct {
	// contains filtered or unexported fields
}

ObjectClientImpl implements the ObjectClient interface

func (*ObjectClientImpl) Create

Create creates a new object in the space

func (*ObjectClientImpl) List

func (oc *ObjectClientImpl) List(ctx context.Context, opts ...options.ListOption) ([]anytype.Object, error)

List returns all objects in the space

type ObjectContextImpl

type ObjectContextImpl struct {
	// contains filtered or unexported fields
}

ObjectContextImpl implements the ObjectContext interface

func (*ObjectContextImpl) Blocks

func (oc *ObjectContextImpl) Blocks() anytype.BlockClient

Blocks returns a BlockClient for this object

func (*ObjectContextImpl) Delete

Delete deletes the object

func (*ObjectContextImpl) Export

func (oc *ObjectContextImpl) Export(ctx context.Context, format string) (*anytype.ExportResult, error)

Export exports the object in the specified format

func (*ObjectContextImpl) Get

Get retrieves the object

func (*ObjectContextImpl) Properties

func (oc *ObjectContextImpl) Properties() anytype.PropertyClient

Properties returns a PropertyClient for this object

func (*ObjectContextImpl) Update

Update updates the object

func (*ObjectContextImpl) UpdateIcon

func (oc *ObjectContextImpl) UpdateIcon(ctx context.Context, icon *anytype.Icon) error

UpdateIcon updates the icon of the object by updating the icon property

func (*ObjectContextImpl) UpdateName

func (oc *ObjectContextImpl) UpdateName(ctx context.Context, name string) error

UpdateName updates the name of the object by updating the name property

type ObjectListClientImpl

type ObjectListClientImpl struct {
	// contains filtered or unexported fields
}

ObjectListClientImpl implements the ObjectListClient interface

func (*ObjectListClientImpl) Add

func (olc *ObjectListClientImpl) Add(ctx context.Context, objectIDs []string) error

Add adds objects to the list

func (*ObjectListClientImpl) List

List returns all objects in the list

type ObjectListContextImpl

type ObjectListContextImpl struct {
	// contains filtered or unexported fields
}

ObjectListContextImpl implements the ObjectListContext interface

func (*ObjectListContextImpl) Remove

func (olc *ObjectListContextImpl) Remove(ctx context.Context) error

Remove removes the object from the list

type ObjectViewClientImpl

type ObjectViewClientImpl struct {
	// contains filtered or unexported fields
}

ObjectViewClientImpl implements the ObjectViewClient interface

func (*ObjectViewClientImpl) List

List returns all objects in the view

type PropertyClientImpl

type PropertyClientImpl struct {
	// contains filtered or unexported fields
}

PropertyClientImpl implements the PropertyClient interface

func (*PropertyClientImpl) Delete

func (pc *PropertyClientImpl) Delete(ctx context.Context, key string) error

Delete removes a property

func (*PropertyClientImpl) Get

Get retrieves a specific property value

func (*PropertyClientImpl) List

List returns all properties of the object

func (*PropertyClientImpl) Set

func (pc *PropertyClientImpl) Set(ctx context.Context, key string, value interface{}) error

Set sets a property value

type SearchClientImpl

type SearchClientImpl struct {
	// contains filtered or unexported fields
}

SearchClientImpl implements the SearchClient interface

func (*SearchClientImpl) Search

Search searches for objects across all spaces

type SpaceClientImpl

type SpaceClientImpl struct {
	// contains filtered or unexported fields
}

SpaceClientImpl implements the SpaceClient interface

func (*SpaceClientImpl) Create

Create creates a new space

func (*SpaceClientImpl) List

List returns all spaces accessible to the user

type SpaceContextImpl

type SpaceContextImpl struct {
	// contains filtered or unexported fields
}

SpaceContextImpl implements the SpaceContext interface

func (*SpaceContextImpl) Get

Get retrieves information about this space

func (*SpaceContextImpl) List

func (sc *SpaceContextImpl) List(listID string) anytype.ListContext

List returns a ListContext for a specific list in this space

func (*SpaceContextImpl) Lists

func (sc *SpaceContextImpl) Lists() anytype.ListClient

Lists returns a ListClient for this space

func (*SpaceContextImpl) Member

func (sc *SpaceContextImpl) Member(memberID string) anytype.MemberContext

Member returns a MemberContext for a specific member in this space

func (*SpaceContextImpl) Members

func (sc *SpaceContextImpl) Members() anytype.MemberClient

Members returns a MemberClient for this space

func (*SpaceContextImpl) Object

func (sc *SpaceContextImpl) Object(objectID string) anytype.ObjectContext

Object returns an ObjectContext for a specific object in this space

func (*SpaceContextImpl) Objects

func (sc *SpaceContextImpl) Objects() anytype.ObjectClient

Objects returns an ObjectClient for this space

func (*SpaceContextImpl) Search

Search searches for objects within this space

func (*SpaceContextImpl) Type

func (sc *SpaceContextImpl) Type(typeID string) anytype.TypeContext

Type returns a TypeContext for a specific type in this space

func (*SpaceContextImpl) Types

func (sc *SpaceContextImpl) Types() anytype.TypeClient

Types returns a TypeClient for this space

type TemplateClientImpl

type TemplateClientImpl struct {
	// contains filtered or unexported fields
}

TemplateClientImpl implements the TemplateClient interface

func (*TemplateClientImpl) Get

func (tc *TemplateClientImpl) Get(ctx context.Context, templateID string) (*anytype.Template, error)

Get retrieves a specific template by ID

func (*TemplateClientImpl) List

List retrieves all templates for a type

type TemplateContextImpl

type TemplateContextImpl struct {
	// contains filtered or unexported fields
}

TemplateContextImpl implements the TemplateContext interface

func (*TemplateContextImpl) Get

Get retrieves details of this specific template

type TypeClientImpl

type TypeClientImpl struct {
	// contains filtered or unexported fields
}

TypeClientImpl implements the TypeClient interface

func (*TypeClientImpl) Get

func (tc *TypeClientImpl) Get(ctx context.Context, typeKey string) (*anytype.Type, error)

Get retrieves details of a specific type by key

func (*TypeClientImpl) GetKeyByName

func (tc *TypeClientImpl) GetKeyByName(ctx context.Context, name string) (string, error)

GetKeyByName looks up a type key by its name

func (*TypeClientImpl) List

func (tc *TypeClientImpl) List(ctx context.Context) ([]anytype.Type, error)

List returns all available object types in the space

func (*TypeClientImpl) Type

func (tc *TypeClientImpl) Type(typeID string) anytype.TypeContext

Type returns a TypeContext for a specific type

type TypeContextImpl

type TypeContextImpl struct {
	// contains filtered or unexported fields
}

TypeContextImpl implements the TypeContext interface

func (*TypeContextImpl) Get

Get retrieves details of this specific type

func (*TypeContextImpl) Template

func (tc *TypeContextImpl) Template(templateID string) anytype.TemplateContext

Template returns a TemplateContext for a specific template of this type

func (*TypeContextImpl) Templates

func (tc *TypeContextImpl) Templates() anytype.TemplateClient

Templates returns a TemplateClient for this type

type ViewClientImpl

type ViewClientImpl struct {
	// contains filtered or unexported fields
}

ViewClientImpl implements the ViewClient interface

func (*ViewClientImpl) List

List retrieves all views for the list

type ViewContextImpl

type ViewContextImpl struct {
	// contains filtered or unexported fields
}

ViewContextImpl implements the ViewContext interface

func (*ViewContextImpl) Objects

Objects returns an ObjectViewClient for this view

Jump to

Keyboard shortcuts

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