Documentation ¶
Overview ¶
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
*
- Copyright 2022 chyroc *
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at *
- http://www.apache.org/licenses/LICENSE-2.0 *
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
Index ¶
- func CellRange(sheetID string, x1, y1, x2, y2 int) string
- func ItoCol(index int) string
- type Bitable
- type BitableTable
- type Doc
- type Folder
- func (r *Folder) DeleteDoc(ctx context.Context, docToken string) error
- func (r *Folder) DeleteSheet(ctx context.Context, sheetToken string) error
- func (r *Folder) ListFiles(ctx context.Context) (map[string]*lark.GetDriveFolderChildrenRespChildren, error)
- func (r *Folder) Meta(ctx context.Context) (*FolderMeta, error)
- func (r *Folder) NewDoc(ctx context.Context, title string) (*Doc, error)
- func (r *Folder) NewFolder(ctx context.Context, title string) (*Folder, error)
- func (r *Folder) NewSheet(ctx context.Context, title string) (*Sheet, error)
- type FolderMeta
- type Sheet
- func (r *Sheet) AddCols(ctx context.Context, sheetID string, count int64) error
- func (r *Sheet) AddRows(ctx context.Context, sheetID string, count int64) error
- func (r *Sheet) Append(ctx context.Context, cellRange string, values [][]lark.SheetContent, ...) error
- func (r *Sheet) BatchCleanCellStyle(ctx context.Context, cellRanges []string) error
- func (r *Sheet) BatchSetCellStyle(ctx context.Context, styles []*lark.BatchSetSheetStyleReqData) error
- func (r *Sheet) BatchSetSheetValue(ctx context.Context, values []*lark.BatchSetSheetValueReqValueRange) error
- func (r *Sheet) CleanCellStyle(ctx context.Context, cellRange string) error
- func (r *Sheet) CopySheet(ctx context.Context, fromSheetID string, toTitle *string) (string, error)
- func (r *Sheet) Delete(ctx context.Context) error
- func (r *Sheet) DeleteCols(ctx context.Context, sheetID string, startIndex, count int64) error
- func (r *Sheet) DeleteRows(ctx context.Context, sheetID string, startIndex, count int64) error
- func (r *Sheet) DeleteSheet(ctx context.Context, sheetID string) error
- func (r *Sheet) FrozenSheet(ctx context.Context, sheetID string, rowCount, colCount int64) error
- func (r *Sheet) Get(ctx context.Context, cellRange string, option *lark.GetSheetValueReq) (*lark.GetSheetValueResp, error)
- func (r *Sheet) HideSheet(ctx context.Context, sheetID string, hidden bool) error
- func (r *Sheet) InsertCols(ctx context.Context, sheetID string, startIndex, count int64) error
- func (r *Sheet) InsertRows(ctx context.Context, sheetID string, startIndex, count int64) error
- func (r *Sheet) LockSheet(ctx context.Context, sheetID string, lockInfo string, editableUserIDs []string) error
- func (r *Sheet) MergeCell(ctx context.Context, cellRange, mergeType string) error
- func (r *Sheet) Meta(ctx context.Context) (*lark.GetSheetMetaResp, error)
- func (r *Sheet) MoveCols(ctx context.Context, sheetID string, startIndex, count, diff int64) error
- func (r *Sheet) MoveRows(ctx context.Context, sheetID string, startIndex, count, diff int64) error
- func (r *Sheet) NewSheet(ctx context.Context, title string) (string, error)
- func (r *Sheet) Replace(ctx context.Context, sheetID, old, new string, ...) (*lark.ReplaceSheetRespReplaceResult, error)
- func (r *Sheet) Search(ctx context.Context, sheetID, value string, ...) (*lark.FindSheetRespFindResult, error)
- func (r *Sheet) SetCellStyle(ctx context.Context, cellRange string, ...) error
- func (r *Sheet) SetColsSize(ctx context.Context, sheetID string, startIndex, count, size int64) error
- func (r *Sheet) SetColsVisible(ctx context.Context, sheetID string, startIndex, count int64, visible bool) error
- func (r *Sheet) SetRowsSize(ctx context.Context, sheetID string, startIndex, count, size int64) error
- func (r *Sheet) SetRowsVisible(ctx context.Context, sheetID string, startIndex, count int64, visible bool) error
- func (r *Sheet) SetSheetIndex(ctx context.Context, sheetID string, index int64) error
- func (r *Sheet) SetSheetTitle(ctx context.Context, sheetID string, title string) error
- func (r *Sheet) SetSheetValue(ctx context.Context, cellRange string, contents [][]lark.SheetContent) error
- func (r *Sheet) SetSheetValueImage(ctx context.Context, cellRange string, image []byte) error
- func (r *Sheet) SetTitle(ctx context.Context, title string) error
- func (r *Sheet) SheetToken() string
- func (r *Sheet) UnlockSheet(ctx context.Context, sheetID string) error
- func (r *Sheet) UnmergeCell(ctx context.Context, cellRange string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CellRange ¶
CellRange 将两个坐标 (x1, y1) 和 (x2, y2) 转成 sheet!A1:D5 的形式
https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/overview https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/conditionformat/condition-format-guide
a. sheetId :表示整表应用 b. sheetId!1:2 :表示整行应用 c. sheetId!A:B :表示整列应用 d. sheetId!A1:C :省略结束行,会使用表格的最后行作为结束行 e. sheetId!A1:B2 :表示普通的range
Types ¶
type Bitable ¶
type Bitable struct {
// contains filtered or unexported fields
}
Bitable Bitable client
func NewBitable ¶
NewBitable new Bitable client
type BitableTable ¶
type BitableTable struct {
// contains filtered or unexported fields
}
BitableTable is a table that can be used to store bitable data.
func NewBitableTable ¶
func NewBitableTable(larkClient *lark.Lark, appToken string, tableID string) *BitableTable
NewBitableTable new a bitable table.
type Doc ¶
type Doc struct {
// contains filtered or unexported fields
}
Doc is doc client
type Folder ¶
type Folder struct {
// contains filtered or unexported fields
}
Folder is folder client
func NewRootFolder ¶
NewRootFolder new root folder client
func (*Folder) DeleteSheet ¶
DeleteSheet delete sheet in folder
func (*Folder) ListFiles ¶
func (r *Folder) ListFiles(ctx context.Context) (map[string]*lark.GetDriveFolderChildrenRespChildren, error)
ListFiles list files in folder
func (*Folder) Meta ¶
func (r *Folder) Meta(ctx context.Context) (*FolderMeta, error)
Meta get folder meta
type FolderMeta ¶
type FolderMeta struct { ID string `json:"id,omitempty"` // 文件夹的 id Name string `json:"name,omitempty"` // 文件夹的标题 Token string `json:"token,omitempty"` // 文件夹的 token CreateUid string `json:"createUid,omitempty"` // 文件夹的创建者 id EditUid string `json:"editUid,omitempty"` // 文件夹的最后编辑者 id ParentID string `json:"parentId,omitempty"` // 文件夹的上级目录 id OwnUid string `json:"ownUid,omitempty"` // 文件夹为个人文件夹时,为文件夹的所有者 id;文件夹为共享文件夹时,为文件夹树id }
FolderMeta is folder meta
type Sheet ¶
type Sheet struct {
// contains filtered or unexported fields
}
Sheet is sheet client
func (*Sheet) Append ¶
func (r *Sheet) Append(ctx context.Context, cellRange string, values [][]lark.SheetContent, option *string) error
Append 追加数据
option 是追加数据模式,默认 OVERWRITE,还可以传入 INSERT_ROWS 当 option == OVERWRITE 的时候,sheet 会找到 range 范围内左上角第一个空白的格子,然后将 values 写入该范围,如果除了「左上角第一个空白的格子」外有其他非空格子,这些格子会被覆盖。 当 option == INSERT_ROWS 的时候,sheet 会找到 range 范围内左上角第一个空白的格子,尝试然后将 values 写入该范围,如果除了「左上角第一个空白的格子」外有其他非空格子,会先将这些格子整体下移几格,知道空间够放下 values
func (*Sheet) BatchCleanCellStyle ¶
BatchCleanCellStyle 批量清除单元格样式
func (*Sheet) BatchSetCellStyle ¶
func (r *Sheet) BatchSetCellStyle(ctx context.Context, styles []*lark.BatchSetSheetStyleReqData) error
BatchSetCellStyle 批量设置单元格样式
func (*Sheet) BatchSetSheetValue ¶
func (r *Sheet) BatchSetSheetValue(ctx context.Context, values []*lark.BatchSetSheetValueReqValueRange) error
BatchSetSheetValue 批量将内容写入单元格
func (*Sheet) CleanCellStyle ¶
CleanCellStyle 清除单元格样式
func (*Sheet) DeleteCols ¶
DeleteCols 删除列
func (*Sheet) DeleteRows ¶
DeleteRows 删除行
func (*Sheet) DeleteSheet ¶
DeleteSheet delete sheet
func (*Sheet) FrozenSheet ¶
FrozenSheet freeze worksheet, 0 means unfreeze
func (*Sheet) Get ¶
func (r *Sheet) Get(ctx context.Context, cellRange string, option *lark.GetSheetValueReq) (*lark.GetSheetValueResp, error)
获取单元格内容
func (*Sheet) InsertCols ¶
InsertCols 插入列,表示从 startIndex 开始插入数量为 count 的列
func (*Sheet) InsertRows ¶
InsertRows 插入行,表示从 startIndex 开始插入数量为 count 的行
func (*Sheet) LockSheet ¶
func (r *Sheet) LockSheet(ctx context.Context, sheetID string, lockInfo string, editableUserIDs []string) error
LockSheet lock worksheet
func (*Sheet) MergeCell ¶
MergeCell 合并单元格
mergeType 支持三种格式 当 mergeType == MERGE_ALL,合并所选区域 当 mergeType == MERGE_ROWS,按行合并 当 mergeType == MERGE_COLUMNS,按列合并
func (*Sheet) MoveCols ¶
MoveCols 移动列,将 sheetID 表中,从 startIndex 列后,数量为 count 的列,移动 diff 列,diff 小于 0 表示左移,diff 大于 0 ,表示右移
func (*Sheet) MoveRows ¶
MoveRows 移动行,将 sheetID 表中,从 startIndex 行后,数量为 count 的行,移动 diff 行,diff 小于 0 表示上移,diff 大于 0 ,表示下移
func (*Sheet) Replace ¶
func (r *Sheet) Replace(ctx context.Context, sheetID, old, new string, condition *lark.ReplaceSheetReqFindCondition) (*lark.ReplaceSheetRespReplaceResult, error)
Replace 替换
func (*Sheet) Search ¶
func (r *Sheet) Search(ctx context.Context, sheetID, value string, condition *lark.FindSheetReqFindCondition) (*lark.FindSheetRespFindResult, error)
Search 搜索
func (*Sheet) SetCellStyle ¶
func (r *Sheet) SetCellStyle(ctx context.Context, cellRange string, style *lark.SetSheetStyleReqAppendStyleStyle) error
SetCellStyle 设置单元格样式
func (*Sheet) SetColsSize ¶
func (r *Sheet) SetColsSize(ctx context.Context, sheetID string, startIndex, count, size int64) error
SetColsSize 设置列的宽度
func (*Sheet) SetColsVisible ¶
func (r *Sheet) SetColsVisible(ctx context.Context, sheetID string, startIndex, count int64, visible bool) error
SetColsVisible 设置列的可见性
func (*Sheet) SetRowsSize ¶
func (r *Sheet) SetRowsSize(ctx context.Context, sheetID string, startIndex, count, size int64) error
SetRowsSize 设置行的高度
func (*Sheet) SetRowsVisible ¶
func (r *Sheet) SetRowsVisible(ctx context.Context, sheetID string, startIndex, count int64, visible bool) error
SetRowsVisible 设置行的可见性
func (*Sheet) SetSheetIndex ¶
SetSheetIndex set sheet index
func (*Sheet) SetSheetTitle ¶
SetSheetTitle set sheet title
func (*Sheet) SetSheetValue ¶
func (r *Sheet) SetSheetValue(ctx context.Context, cellRange string, contents [][]lark.SheetContent) error
SetSheetValue 将内容写入单元格
func (*Sheet) SetSheetValueImage ¶
SetSheetValueImage 将图片写入单元格
func (*Sheet) UnlockSheet ¶
UnlockSheet unlock worksheet