Coder Social home page Coder Social logo

gxthrj / skywalking-goapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apache/skywalking-goapi

0.0 0.0 0.0 333 KB

Apache SkyWalking API in Golang.

Home Page: https://skywalking.apache.org/

License: Apache License 2.0

Shell 91.00% Makefile 9.00%

skywalking-goapi's Introduction

SkyWalking Go APIs

This repository contains the Go files generated from the sniff protocol(data collect protocol, the satellite protocol) and the query protocol for convenient use.

You can use the following commands to install this module.

go get skywalking.apache.org/repo/goapi

Data Sniff Protocol

To use the Go files generated from the data collect protocol and the satellite protocol, use the import path skywalking.apache.org/repo/goapi/collect and skywalking.apache.org/repo/goapi/satellite, for example,

package main

import (
	"fmt"
	"time"

	v3 "skywalking.apache.org/repo/goapi/collect/event/v3"
	v1 "skywalking.apache.org/repo/goapi/satellite/data/v1"
)

func main() {
	event := &v3.Event{
		Uuid:       "",
		Source:     nil,
		Name:       "",
		Type:       0,
		Message:    "",
		Parameters: nil,
		StartTime:  0,
		EndTime:    0,
	}

	sniffData := &v1.SniffData{
		Timestamp: time.Now().Unix() / 1e6,
		Name:      "Satellite_event",
		Type:      v1.SniffType_EventType,
		Meta:      nil,
		Remote:    true,
		Data: &v1.SniffData_Event{
			Event: event,
		},
	}
	fmt.Printf("+%v", sniffData)
}

Query Protocol

To use the Go files generated from the query protocol, use the import path skywalking.apache.org/repo/goapi/query, for example,

package main

import (
	"fmt"

	"skywalking.apache.org/repo/goapi/query"
)

func main() {
	events := query.Events{
		Events: nil,
		Total:  0,
	}

	fmt.Printf("+%v", events)
}

Development

To update this repo, update the commit sha in the dependencies.sh file, and run make to regenerate the Go files, then commit and open a pull request.

skywalking-goapi's People

Contributors

calvinkirs avatar evanljp avatar jaredtan95 avatar kezhenxu94 avatar mrproliu avatar wu-sheng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.