lark

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntityLark        = "lark"
	Host              = "open.larksuite.com"
	GetAccessTokenURL = "/open-apis/auth/v3/tenant_access_token/internal"
	GetLSheetContent  = "/open-apis/sheets/v2/spreadsheets/%s/values/%s"
	GetLSheetMeta     = "/open-apis/sheets/v2/spreadsheets/%s/metainfo"
)

Variables

This section is empty.

Functions

func FromRange

func FromRange(sheetRange string) (string, string)

func FromURL

func FromURL(u1 string) (string, error)

Types

type Client

type Client struct {
	TenantAccessToken string
	// contains filtered or unexported fields
}

func NewLarkClient

func NewLarkClient(ctx context.Context, authSecret string) (*Client, error)

func (*Client) GetAsCSV

func (lc *Client) GetAsCSV(ctx context.Context, url, sheetRange string, getFormattedDateTime, getFormattedData bool, columnCount int, formatFn func(int, int, any) (string, error)) (int, string, error)

func (*Client) GetRevisionID

func (lc *Client) GetRevisionID(ctx context.Context, url string) (int, error)

func (*Client) GetSheetContent

func (lc *Client) GetSheetContent(ctx context.Context, sheetToken, sheetRange string, getFormattedDateTime, getFormattedData bool) ([][]interface{}, error)

func (*Client) GetSheetMetadata

func (lc *Client) GetSheetMetadata(ctx context.Context, sheetToken string) (*SheetMetadata, error)

func (*Client) Invoke

func (lc *Client) Invoke(ctx context.Context, r larkRequest) ([]byte, error)

type Data

type Data struct {
	Properties       Properties `json:"properties"`
	Sheets           []Sheet    `json:"sheets"`
	SpreadsheetToken string     `json:"spreadsheetToken"`
}

type GetSpreadSheetResponse

type GetSpreadSheetResponse struct {
	Code            int             `json:"code"`
	SpreadSheetData SpreadSheetData `json:"data"`
	Msg             string          `json:"msg"`
}

type Properties

type Properties struct {
	OwnerUser  int64  `json:"ownerUser"`
	Revision   int    `json:"revision"`
	SheetCount int    `json:"sheetCount"`
	Title      string `json:"title"`
}

type Sheet

type Sheet struct {
	ColumnCount    int    `json:"columnCount"`
	FrozenColCount int    `json:"frozenColCount"`
	FrozenRowCount int    `json:"frozenRowCount"`
	Index          int    `json:"index"`
	RowCount       int    `json:"rowCount"`
	SheetID        string `json:"sheetId"`
	Title          string `json:"title"`
}

type SheetMetadata

type SheetMetadata struct {
	Code int    `json:"code"`
	Data Data   `json:"data"`
	Msg  string `json:"msg"`
}

func (SheetMetadata) GetRevisionID

func (s SheetMetadata) GetRevisionID() int

type SpreadSheetData

type SpreadSheetData struct {
	Revision         int        `json:"revision"`
	SpreadsheetToken string     `json:"spreadsheetToken"`
	ValueRange       ValueRange `json:"valueRange"`
}

type TokenResponse

type TokenResponse struct {
	Code              int    `json:"code"`
	Expire            int    `json:"expire"`
	Msg               string `json:"msg"`
	TenantAccessToken string `json:"tenant_access_token"`
}

type ValueRange

type ValueRange struct {
	MajorDimension string          `json:"majorDimension"`
	Range          string          `json:"range"`
	Revision       int             `json:"revision"`
	Values         [][]interface{} `json:"values"`
}

Jump to

Keyboard shortcuts

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