Documentation
¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, name string, sc SchemaEncoder, opts ...CreateOptions) (entity.Id, error)
- func (c *Client) CreateOrUpdate(ctx context.Context, name string, sc SchemaEncoder, opts ...CreateOptions) (entity.Id, error)
- func (c *Client) Delete(ctx context.Context, id entity.Id) error
- func (c *Client) EAC() *entityserver_v1alpha.EntityAccessClient
- func (c *Client) Get(ctx context.Context, name string, sc SchemaEncoder) error
- func (c *Client) GetAttributesByTag(ctx context.Context, tag string) (*entityserver_v1alpha.EntityAccessClientGetAttributesByTagResults, error)
- func (c *Client) GetById(ctx context.Context, id entity.Id, sc SchemaEncoder) error
- func (c *Client) GetByIdWithEntity(ctx context.Context, id entity.Id, sc SchemaEncoder) (*entityserver_v1alpha.Entity, error)
- func (c *Client) List(ctx context.Context, index entity.Attr) (*ListResults, error)
- func (c *Client) NewSession(ctx context.Context, usage string) (*Session, *Client, error)
- func (c *Client) OneAtIndex(ctx context.Context, index entity.Attr, sc SchemaEncoder) error
- func (c *Client) Patch(ctx context.Context, id entity.Id, revision int64, attrs ...entity.Attr) error
- func (c *Client) Update(ctx context.Context, sc SchemaEncoderWithId) error
- func (c *Client) UpdateAttrs(ctx context.Context, id entity.Id, attrs ...any) error
- func (c *Client) WatchEntity(ctx context.Context, id entity.Id) chan *entity.Entity
- type CreateOptions
- type ListResults
- type SchemaEncoder
- type SchemaEncoderWithId
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(log *slog.Logger, eac *entityserver_v1alpha.EntityAccessClient) *Client
func (*Client) Create ¶
func (c *Client) Create(ctx context.Context, name string, sc SchemaEncoder, opts ...CreateOptions) (entity.Id, error)
func (*Client) CreateOrUpdate ¶
func (c *Client) CreateOrUpdate(ctx context.Context, name string, sc SchemaEncoder, opts ...CreateOptions) (entity.Id, error)
func (*Client) EAC ¶ added in v0.4.0
func (c *Client) EAC() *entityserver_v1alpha.EntityAccessClient
EAC returns the underlying EntityAccessClient.
func (*Client) GetAttributesByTag ¶
func (c *Client) GetAttributesByTag(ctx context.Context, tag string) (*entityserver_v1alpha.EntityAccessClientGetAttributesByTagResults, error)
func (*Client) GetByIdWithEntity ¶
func (c *Client) GetByIdWithEntity(ctx context.Context, id entity.Id, sc SchemaEncoder) (*entityserver_v1alpha.Entity, error)
func (*Client) NewSession ¶
Grant creates a new lease with the given TTL
func (*Client) OneAtIndex ¶
func (*Client) Patch ¶ added in v0.3.0
func (c *Client) Patch(ctx context.Context, id entity.Id, revision int64, attrs ...entity.Attr) error
Patch updates specific attributes on an entity without replacing the entire entity. Pass revision 0 to skip optimistic concurrency control, or a specific revision to ensure the entity hasn't been modified since it was read.
func (*Client) UpdateAttrs ¶
type CreateOptions ¶
type CreateOptions func(o *createOp)
func WithLabels ¶
func WithLabels(labels types.Labels) CreateOptions
type ListResults ¶
type ListResults struct {
// contains filtered or unexported fields
}
func (*ListResults) Entity ¶
func (l *ListResults) Entity() *entity.Entity
func (*ListResults) Length ¶
func (l *ListResults) Length() int
func (*ListResults) Metadata ¶
func (l *ListResults) Metadata() *core_v1alpha.Metadata
func (*ListResults) Next ¶
func (l *ListResults) Next() bool
func (*ListResults) Read ¶
func (l *ListResults) Read(sc SchemaEncoder) error
type SchemaEncoder ¶
type SchemaEncoderWithId ¶
type SchemaEncoderWithId interface {
SchemaEncoder
EntityId() entity.Id
}
Click to show internal directories.
Click to hide internal directories.