DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

chyroc
chyroc

Posted on

A Go SDK that supports more than 500 LarkSuite/Feishu's open API

The project address is: https://github.com/chyroc/lark

The project refers to the writing of gitlab's sdk, unified the writing of parameters and return values, and supports the processing of nearly 500 interfaces and 50 callback event types. Welcome to star.

The project was written 5 months ago, and it has developed freely until now. It has 70 stars and has ranked first under the topic of larksuite-sdk (https://github.com/topics/larksuite-sdk), so Send it to dev.to and introduce it to you in need.

LarkSuite(Non-China)/Feishu(China) has developed rapidly recently, and the number of open platform interfaces has been increasing rapidly. I manually maintained the sdk for a period of time before, but later found that manual maintenance was unrealistic. I changed the code to read the document and then automatically generated the code to maintain the sdk, which is this project.

Because it is an automatically generated relationship, it supports almost all interfaces, including contacts, messages, groups, calendars, documents, etc.

The following is a scene of creating a calendar to give a very simple and easy-to-use example of the sdk:

package main

import (
    "context"
    "fmt"

    "github.com/chyroc/go-ptr"

    "github.com/chyroc/lark"
)

func example()  {
    cli := lark.New(lark.WithAppCredential("<APP_ID>", "<APP_SECRET>"))

    resp, _, err := cli.Calendar.CreateCalendar(ctx, &lark.CreateCalendarReq{
        Summary: ptr.String("<SUMMARY>"),
    })
    fmt.Println(resp, err)
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

🌚 Browsing with dark mode makes you a better developer.

It's a scientific fact.