lark

package module
v3.4.51 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: MIT Imports: 56 Imported by: 0

README

飞书开放接口SDK/Feishu OpenPlatform Server SDK

旨在让开发者便捷的调用飞书开放API、处理订阅的事件、处理服务端推送的卡片行为等。

Feishu Open Platform offers a series of server-side atomic APIs to achieve diverse functionalities. However, actual coding requires additional work, such as obtaining and maintaining access tokens, encrypting and decrypting data, and verifying request signatures. Furthermore, the lack of semantic descriptions for function calls and type system support can increase coding burdens.

To address these issues, Feishu Open Platform has developed the Open Interface SDK, which incorporates all lengthy logic processes, provides a comprehensive type system, and offers a semantic programming interface to enhance the coding experience.

介绍文档 Introduction Documents

扩展示例

我们还基于 SDK 封装了常用的 API 组合调用及业务场景示例,如:

更多示例可参考:https://github.com/larksuite/oapi-sdk-go-demo

加入交流互助群

单击加入交流互助

License

使用 MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FeishuBaseUrl = "https://open.feishu.cn"
View Source
var LarkBaseUrl = "https://open.larksuite.com"

Functions

This section is empty.

Types

type Client

type Client struct {
	Docs                   *docs.Service
	Helpdesk               *helpdesk.Service
	Hire                   *hire.Service
	Mail                   *mail.Service
	PersonalSettings       *personal_settings.Service
	Acs                    *acs.Service
	Authen                 *authen.Service
	Block                  *block.Service
	Task                   *task.Service
	Workplace              *workplace.Service
	Translation            *translation.Service
	Application            *application.Service
	Lingo                  *lingo.Service
	MeetingRoom            *meeting_room.Service
	OpticalCharRecognition *optical_char_recognition.Service
	Tenant                 *tenant.Service
	Board                  *board.Service
	Corehr                 *corehr.Service
	HumanAuthentication    *human_authentication.Service
	DocumentAi             *document_ai.Service
	Drive                  *drive.Service
	Mdm                    *mdm.Service
	Aily                   *aily.Service
	Auth                   *auth.Service
	Contact                *contact.Service
	GrayTestOpenSg         *gray_test_open_sg.Service
	Sheets                 *sheets.Service
	Approval               *approval.Service
	Attendance             *attendance.Service
	Docx                   *docx.Service
	Moments                *moments.Service
	Wiki                   *wiki.Service
	Admin                  *admin.Service
	Bitable                *bitable.Service
	Calendar               *calendar.Service
	Verification           *verification.Service
	Passport               *passport.Service
	SecurityAndCompliance  *security_and_compliance.Service
	SpeechToText           *speech_to_text.Service
	Event                  *event.Service
	Im                     *im.Service
	Okr                    *okr.Service
	Report                 *report.Service
	Search                 *search.Service
	Baike                  *baike.Service
	Compensation           *compensation.Service
	Ehr                    *ehr.Service
	Vc                     *vc.Service
	Ext                    *larkext.ExtService
	// contains filtered or unexported fields
}

func NewClient

func NewClient(appId, appSecret string, options ...ClientOptionFunc) *Client

func (*Client) Delete

func (cli *Client) Delete(ctx context.Context, httpPath string, body interface{}, accessTokeType larkcore.AccessTokenType, options ...larkcore.RequestOptionFunc) (*larkcore.ApiResp, error)

func (*Client) Do

func (cli *Client) Do(ctx context.Context, apiReq *larkcore.ApiReq, options ...larkcore.RequestOptionFunc) (*larkcore.ApiResp, error)

func (*Client) Get

func (cli *Client) Get(ctx context.Context, httpPath string, body interface{}, accessTokeType larkcore.AccessTokenType, options ...larkcore.RequestOptionFunc) (*larkcore.ApiResp, error)

func (*Client) GetAppAccessTokenByMarketplaceApp

func (cli *Client) GetAppAccessTokenByMarketplaceApp(ctx context.Context, req *larkcore.MarketplaceAppAccessTokenReq) (*larkcore.AppAccessTokenResp, error)

func (*Client) GetAppAccessTokenBySelfBuiltApp

func (cli *Client) GetAppAccessTokenBySelfBuiltApp(ctx context.Context, req *larkcore.SelfBuiltAppAccessTokenReq) (*larkcore.AppAccessTokenResp, error)

func (*Client) GetTenantAccessTokenByMarketplaceApp

func (cli *Client) GetTenantAccessTokenByMarketplaceApp(ctx context.Context, req *larkcore.MarketplaceTenantAccessTokenReq) (*larkcore.TenantAccessTokenResp, error)

func (*Client) GetTenantAccessTokenBySelfBuiltApp

func (cli *Client) GetTenantAccessTokenBySelfBuiltApp(ctx context.Context, req *larkcore.SelfBuiltTenantAccessTokenReq) (*larkcore.TenantAccessTokenResp, error)

func (*Client) Patch

func (cli *Client) Patch(ctx context.Context, httpPath string, body interface{}, accessTokeType larkcore.AccessTokenType, options ...larkcore.RequestOptionFunc) (*larkcore.ApiResp, error)

func (*Client) Post

func (cli *Client) Post(ctx context.Context, httpPath string, body interface{}, accessTokeType larkcore.AccessTokenType, options ...larkcore.RequestOptionFunc) (*larkcore.ApiResp, error)

func (*Client) Put

func (cli *Client) Put(ctx context.Context, httpPath string, body interface{}, accessTokeType larkcore.AccessTokenType, options ...larkcore.RequestOptionFunc) (*larkcore.ApiResp, error)

func (*Client) ResendAppTicket

func (cli *Client) ResendAppTicket(ctx context.Context, req *larkcore.ResendAppTicketReq) (*larkcore.ResendAppTicketResp, error)

type ClientOptionFunc

type ClientOptionFunc func(config *larkcore.Config)

func WithAppType

func WithAppType(appType larkcore.AppType) ClientOptionFunc

func WithEnableTokenCache

func WithEnableTokenCache(enableTokenCache bool) ClientOptionFunc

func WithHeaders

func WithHeaders(header http.Header) ClientOptionFunc

设置每次请求都会携带的 header

func WithHelpdeskCredential

func WithHelpdeskCredential(helpdeskID, helpdeskToken string) ClientOptionFunc

func WithHttpClient

func WithHttpClient(httpClient larkcore.HttpClient) ClientOptionFunc

func WithLogLevel

func WithLogLevel(logLevel larkcore.LogLevel) ClientOptionFunc

func WithLogReqAtDebug

func WithLogReqAtDebug(printReqRespLog bool) ClientOptionFunc

func WithLogger

func WithLogger(logger larkcore.Logger) ClientOptionFunc

func WithMarketplaceApp

func WithMarketplaceApp() ClientOptionFunc

func WithOpenBaseUrl

func WithOpenBaseUrl(baseUrl string) ClientOptionFunc

func WithReqTimeout

func WithReqTimeout(reqTimeout time.Duration) ClientOptionFunc

func WithSerialization

func WithSerialization(serializable larkcore.Serializable) ClientOptionFunc

func WithTokenCache

func WithTokenCache(cache larkcore.Cache) ClientOptionFunc

Jump to

Keyboard shortcuts

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