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 ¶
- Variables
- func NewClient(options anytype.ClientOptions) anytype.Client
- type AuthClientImpl
- type BlockClientImpl
- func (bc *BlockClientImpl) Create(ctx context.Context, request anytype.CreateBlockRequest) (*anytype.Block, error)
- func (bc *BlockClientImpl) Delete(ctx context.Context, blockID string) error
- func (bc *BlockClientImpl) Get(ctx context.Context, blockID string) (*anytype.Block, error)
- func (bc *BlockClientImpl) List(ctx context.Context) ([]anytype.Block, error)
- func (bc *BlockClientImpl) Update(ctx context.Context, blockID string, request anytype.UpdateBlockRequest) error
- type ClientImpl
- type ListClientImpl
- func (lc *ListClientImpl) Add(ctx context.Context, objectIDs []string) error
- func (lc *ListClientImpl) AddObjects(ctx context.Context, listID string, objectIDs []string) error
- func (lc *ListClientImpl) GetObjects(ctx context.Context, listID string, viewID string) ([]anytype.Object, error)
- func (lc *ListClientImpl) GetViews(ctx context.Context, listID string) ([]anytype.ListView, error)
- func (lc *ListClientImpl) RemoveObject(ctx context.Context, listID string, objectID string) error
- type ListContextImpl
- type MemberClientImpl
- type MemberContextImpl
- type ObjectClientImpl
- type ObjectContextImpl
- func (oc *ObjectContextImpl) Blocks() anytype.BlockClient
- func (oc *ObjectContextImpl) Delete(ctx context.Context) (*anytype.ObjectResponse, error)
- func (oc *ObjectContextImpl) Export(ctx context.Context, format string) (*anytype.ExportResult, error)
- func (oc *ObjectContextImpl) Get(ctx context.Context) (*anytype.ObjectResponse, error)
- func (oc *ObjectContextImpl) Properties() anytype.PropertyClient
- func (oc *ObjectContextImpl) Update(ctx context.Context, request anytype.UpdateObjectRequest) error
- func (oc *ObjectContextImpl) UpdateIcon(ctx context.Context, icon *anytype.Icon) error
- func (oc *ObjectContextImpl) UpdateName(ctx context.Context, name string) error
- type ObjectListClientImpl
- type ObjectListContextImpl
- type ObjectViewClientImpl
- type PropertyClientImpl
- func (pc *PropertyClientImpl) Delete(ctx context.Context, key string) error
- func (pc *PropertyClientImpl) Get(ctx context.Context, key string) (*anytype.Property, error)
- func (pc *PropertyClientImpl) List(ctx context.Context) ([]anytype.Property, error)
- func (pc *PropertyClientImpl) Set(ctx context.Context, key string, value interface{}) error
- type SearchClientImpl
- type SpaceClientImpl
- type SpaceContextImpl
- func (sc *SpaceContextImpl) Get(ctx context.Context) (*anytype.SpaceResponse, error)
- func (sc *SpaceContextImpl) List(listID string) anytype.ListContext
- func (sc *SpaceContextImpl) Lists() anytype.ListClient
- func (sc *SpaceContextImpl) Member(memberID string) anytype.MemberContext
- func (sc *SpaceContextImpl) Members() anytype.MemberClient
- func (sc *SpaceContextImpl) Object(objectID string) anytype.ObjectContext
- func (sc *SpaceContextImpl) Objects() anytype.ObjectClient
- func (sc *SpaceContextImpl) Search(ctx context.Context, request anytype.SearchRequest) (*anytype.SearchResponse, error)
- func (sc *SpaceContextImpl) Type(typeID string) anytype.TypeContext
- func (sc *SpaceContextImpl) Types() anytype.TypeClient
- type TemplateClientImpl
- type TemplateContextImpl
- type TypeClientImpl
- func (tc *TypeClientImpl) Get(ctx context.Context, typeKey string) (*anytype.Type, error)
- func (tc *TypeClientImpl) GetKeyByName(ctx context.Context, name string) (string, error)
- func (tc *TypeClientImpl) List(ctx context.Context) ([]anytype.Type, error)
- func (tc *TypeClientImpl) Type(typeID string) anytype.TypeContext
- type TypeContextImpl
- type ViewClientImpl
- type ViewContextImpl
Constants ¶
This section is empty.
Variables ¶
var ErrTypeNotFound = errors.New("type not found")
Functions ¶
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 ¶
func (bc *BlockClientImpl) Create(ctx context.Context, request anytype.CreateBlockRequest) (*anytype.Block, error)
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) 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 ¶
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) RemoveObject ¶
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 ¶
func (lc *ListContextImpl) Objects() anytype.ObjectListClient
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 ¶
func (mc *MemberClientImpl) List(ctx context.Context) (*anytype.MemberListResponse, error)
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 ¶
func (mc *MemberContextImpl) Get(ctx context.Context) (*anytype.MemberResponse, error)
Get retrieves details about this member
type ObjectClientImpl ¶
type ObjectClientImpl struct {
// contains filtered or unexported fields
}
ObjectClientImpl implements the ObjectClient interface
func (*ObjectClientImpl) Create ¶
func (oc *ObjectClientImpl) Create(ctx context.Context, request anytype.CreateObjectRequest) (*anytype.ObjectResponse, error)
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 ¶
func (oc *ObjectContextImpl) Delete(ctx context.Context) (*anytype.ObjectResponse, error)
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 ¶
func (oc *ObjectContextImpl) Get(ctx context.Context) (*anytype.ObjectResponse, error)
Get retrieves the object
func (*ObjectContextImpl) Properties ¶
func (oc *ObjectContextImpl) Properties() anytype.PropertyClient
Properties returns a PropertyClient for this object
func (*ObjectContextImpl) Update ¶
func (oc *ObjectContextImpl) Update(ctx context.Context, request anytype.UpdateObjectRequest) error
Update updates the object
func (*ObjectContextImpl) UpdateIcon ¶
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 ¶
func (olc *ObjectListClientImpl) List(ctx context.Context) (*anytype.ObjectListResponse, error)
List returns all objects in the list
type ObjectListContextImpl ¶
type ObjectListContextImpl struct {
// contains filtered or unexported fields
}
ObjectListContextImpl implements the ObjectListContext interface
type ObjectViewClientImpl ¶
type ObjectViewClientImpl struct {
// contains filtered or unexported fields
}
ObjectViewClientImpl implements the ObjectViewClient interface
func (*ObjectViewClientImpl) List ¶
func (ovc *ObjectViewClientImpl) List(ctx context.Context) (*anytype.ObjectListResponse, error)
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
type SearchClientImpl ¶
type SearchClientImpl struct {
// contains filtered or unexported fields
}
SearchClientImpl implements the SearchClient interface
func (*SearchClientImpl) Search ¶
func (sc *SearchClientImpl) Search(ctx context.Context, request anytype.SearchRequest) (*anytype.SearchResponse, error)
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 ¶
func (sc *SpaceClientImpl) Create(ctx context.Context, request anytype.CreateSpaceRequest) (*anytype.CreateSpaceResponse, error)
Create creates a new space
func (*SpaceClientImpl) List ¶
func (sc *SpaceClientImpl) List(ctx context.Context) (*anytype.SpaceListResponse, error)
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 ¶
func (sc *SpaceContextImpl) Get(ctx context.Context) (*anytype.SpaceResponse, error)
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 ¶
func (sc *SpaceContextImpl) Search(ctx context.Context, request anytype.SearchRequest) (*anytype.SearchResponse, error)
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
type TemplateContextImpl ¶
type TemplateContextImpl struct {
// contains filtered or unexported fields
}
TemplateContextImpl implements the TemplateContext interface
func (*TemplateContextImpl) Get ¶
func (tc *TemplateContextImpl) Get(ctx context.Context) (*anytype.TemplateResponse, error)
Get retrieves details of this specific template
type TypeClientImpl ¶
type TypeClientImpl struct {
// contains filtered or unexported fields
}
TypeClientImpl implements the TypeClient interface
func (*TypeClientImpl) GetKeyByName ¶
GetKeyByName looks up a type key by its name
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 ¶
func (tc *TypeContextImpl) Get(ctx context.Context) (*anytype.TypeResponse, error)
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 ¶
func (vc *ViewClientImpl) List(ctx context.Context) (*anytype.ViewListResponse, error)
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 ¶
func (vc *ViewContextImpl) Objects() anytype.ObjectViewClient
Objects returns an ObjectViewClient for this view