larkbase

package module
v1.0.54 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 17 Imported by: 0

README

larkbase

A simple larkbase sdk.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAll added in v1.0.43

func CreateAll(ctx context.Context, url string, data []map[string]string, objPutFn func(string, string) (string, string, error)) error

func CreateTable added in v1.0.45

func CreateTable(ctx context.Context, name string, fields []string) (string, error)

func DescribeTable

func DescribeTable(ctx context.Context, url string) (string, error)

func SetAppIdSecret added in v1.0.33

func SetAppIdSecret(appId_, appSecret_ string)

Types

type AnyRecord added in v1.0.26

type AnyRecord struct {
	Meta
	Id   NumberField `lark:"id"`
	Data map[string]string
	// contains filtered or unexported fields
}

func (*AnyRecord) Update added in v1.0.31

func (r *AnyRecord) Update(k, v string)

type AutoNumberField

type AutoNumberField = larkfield.AutoNumberField

type BarcodeField

type BarcodeField = larkfield.TextField

type CheckboxField

type CheckboxField = larkfield.CheckboxField

type Condition

type Condition = larkfield.Condition

type Connection

type Connection[T any] struct {
	// contains filtered or unexported fields
}

func Connect

func Connect[T any](ctx context.Context) (*Connection[T], error)

func ConnectAny added in v1.0.26

func ConnectAny(ctx context.Context, tableUrl string) (*Connection[AnyRecord], error)

func ConnectUrl added in v1.0.26

func ConnectUrl[T any](ctx context.Context, tableUrl string) (*Connection[T], error)

func (*Connection[T]) AppToken added in v1.0.26

func (c *Connection[T]) AppToken() string

func (*Connection[T]) Condition

func (c *Connection[T]) Condition() *T

func (*Connection[T]) Context added in v1.0.37

func (c *Connection[T]) Context() context.Context

func (*Connection[T]) Count added in v1.0.54

func (c *Connection[T]) Count(opt *FindOption) (int, error)

func (*Connection[T]) Create

func (c *Connection[T]) Create(structPtr *T) error

func (*Connection[T]) CreateAll

func (c *Connection[T]) CreateAll(structPtrSlice []*T) ([]*T, error)

func (*Connection[T]) CreateAllAny added in v1.0.43

func (c *Connection[T]) CreateAllAny(fields []string, records []*AnyRecord) ([]*T, error)

func (*Connection[T]) CreateField added in v1.0.5

func (c *Connection[T]) CreateField(name string, type_ larkfield.Type) error

func (*Connection[T]) CreateView

func (c *Connection[T]) CreateView(name string, filter *ViewFilter) error

func (*Connection[T]) Delete

func (c *Connection[T]) Delete(structPtr *T) error

func (*Connection[T]) DeleteAll

func (c *Connection[T]) DeleteAll(structPtrSlice []*T) error

func (*Connection[T]) FilterAnd

func (c *Connection[T]) FilterAnd(conditions ...*Condition) *Filter

func (*Connection[T]) FilterOr

func (c *Connection[T]) FilterOr(conditions ...*Condition) *Filter

func (*Connection[T]) Find

func (c *Connection[T]) Find(structPtr *T, opt *FindOption) error

func (*Connection[T]) FindAll

func (c *Connection[T]) FindAll(structPtrSlicePtr *[]*T, opt *FindOption) error

func (*Connection[T]) IsNotFoundError

func (c *Connection[T]) IsNotFoundError(err error) bool

func (*Connection[T]) ListFields added in v1.0.5

func (c *Connection[T]) ListFields() (map[string]larkfield.Type, error)

func (*Connection[T]) MarshalIgnoreError

func (c *Connection[T]) MarshalIgnoreError(x any) string

func (*Connection[T]) MarshalRecord

func (c *Connection[T]) MarshalRecord(structPtr *T) (string, error)

func (*Connection[T]) MarshalRecords

func (c *Connection[T]) MarshalRecords(structPtrSlice []*T) (string, error)

func (*Connection[T]) SetBatchSize added in v1.0.29

func (c *Connection[T]) SetBatchSize(batchSize int)

func (*Connection[T]) Sort

func (c *Connection[T]) Sort() *T

func (*Connection[T]) StructName added in v1.0.26

func (c *Connection[T]) StructName() string

func (*Connection[T]) SyncFromApi added in v1.0.21

func (c *Connection[T]) SyncFromApi(getUpdatedFunc func(context.Context, string, time.Time) []map[string]any) error

func (*Connection[T]) SyncToDatabase added in v1.0.5

func (c *Connection[T]) SyncToDatabase(db *gorm.DB, batchSize int) error

func (*Connection[T]) TableId added in v1.0.26

func (c *Connection[T]) TableId() string

func (*Connection[T]) TableUrl added in v1.0.26

func (c *Connection[T]) TableUrl() string

func (*Connection[T]) Update

func (c *Connection[T]) Update(structPtr *T) error

func (*Connection[T]) UpdateAll

func (c *Connection[T]) UpdateAll(structPtrSlice []*T) error

func (*Connection[T]) ViewFilterAnd

func (c *Connection[T]) ViewFilterAnd(conditions ...*Condition) *ViewFilter

func (*Connection[T]) ViewFilterOr

func (c *Connection[T]) ViewFilterOr(conditions ...*Condition) *ViewFilter

func (*Connection[T]) ViewId added in v1.0.26

func (c *Connection[T]) ViewId() string

type CurrencyField

type CurrencyField = larkfield.NumberField

type DateField

type DateField = larkfield.DateField

type EmailField

type EmailField = larkfield.TextField

type Filter

type Filter = bitable.FilterInfo

type FindOption added in v1.0.15

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

func NewFindOption added in v1.0.21

func NewFindOption(filter *bitable.FilterInfo, sorts ...*bitable.Sort) *FindOption

func NewViewIdFindOption added in v1.0.21

func NewViewIdFindOption(viewId string) *FindOption

func (*FindOption) Limit added in v1.0.15

func (o *FindOption) Limit(limit int) *FindOption

type FormulaField added in v1.0.16

type FormulaField = larkfield.FormulaField

type LookupField added in v1.0.16

type LookupField = larkfield.LookupField

type Meta

type Meta struct {
	RecordId     string
	ModifiedTime time.Time
}

type ModifiedTimeField added in v1.0.5

type ModifiedTimeField = larkfield.ModifiedTimeField

type MultiSelectField

type MultiSelectField = larkfield.MultiSelectField

type NumberField

type NumberField = larkfield.NumberField

type ProgressField

type ProgressField = larkfield.NumberField

type RatingField

type RatingField = larkfield.NumberField

type Record

type Record struct {
	Id           string
	ModifiedTime time.Time
	Fields       map[string]larkfield.Field
}

func NewRecord

func NewRecord() *Record

type SingleSelectField

type SingleSelectField = larkfield.SingleSelectField

type TextField

type TextField = larkfield.TextField

type UrlField

type UrlField = larkfield.UrlField

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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