Log Service SDK for Go encapsulates all API operations of Log Service. You can use Log Service SDK for Go to call all API operations of Log Service.

Versions

For more information, see Alibaba Cloud Log Service SDK for Go Releases.

Sample code

Log Service SDK for Go provides a variety of sample code that you can use or reference. The following table describes the sample code that is provided by Log Service SDK for Go.
GitHub source code Description
alert_example.go Includes sample code that shows how to configure alerts. The sample code is used to provide the original alerting feature.
index_sample.go Includes sample code that shows how to create indexes, write log data, and query log data.
log_logstore.go Includes sample code that shows how to create and modify a Logstore.
machine_group_sample.go Includes sample code that shows how to manage the mapping relationships between machine groups and Logtail configurations.
shipper_sample.go Includes sample code that shows how to create a log shipping task.
simple_demo.go Includes sample code that shows how to use a consumer group to read data.
log_config_json.go Includes sample code that shows how to create Logtail configurations in JSON mode.
main.go Includes sample code that shows how to query log data.
client_alert_test.go Includes sample code that shows how to configure alerts. The sample code is used to provide the new alerting feature.
client_alert_resource_test.go Includes sample code that shows how to create resources that can be used to configure alerts. The sample code is used to create resources that can provide the new alerting feature.