GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lytics/go-lytics: Lytics SDK for Go (Golang)

BranchesTags
Open more actions menu

Latest commit

 

History

98 Commits
98 Commits

Folders and files

NameName
Last commit message
Last commit date
examples
examples
 
 
mock
mock
 
 
.travis.yml
.travis.yml
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
account.go
account.go
 
 
account_test.go
account_test.go
 
 
auth.go
auth.go
 
 
auth_test.go
auth_test.go
 
 
campaign.go
campaign.go
 
 
campaign_test.go
campaign_test.go
 
 
catalog.go
catalog.go
 
 
catalog_test.go
catalog_test.go
 
 
content.go
content.go
 
 
content_test.go
content_test.go
 
 
entity.go
entity.go
 
 
entity_test.go
entity_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
json.go
json.go
 
 
json_test.go
json_test.go
 
 
lytics.go
lytics.go
 
 
lytics_test.go
lytics_test.go
 
 
provider.go
provider.go
 
 
provider_test.go
provider_test.go
 
 
query.go
query.go
 
 
segment.go
segment.go
 
 
segment_test.go
segment_test.go
 
 
segmentml.go
segmentml.go
 
 
segmentml_test.go
segmentml_test.go
 
 
user.go
user.go
 
 
user_test.go
user_test.go
 
 
work.go
work.go
 
 
work_test.go
work_test.go
 
 

Repository files navigation

Build Status

Lytics SDK for Go

The Lytics SDK for go offers easy integration with our public REST API endpoints. This library is actively being managed and every effort will be made to ensure that all handling reflects the best methods available. Overview of supported methods outlined below.

Full REST API Documentation

https://learn.lytics.com/api-docs

Command Line Tool Doc

The Lytics CLI utilizes this library.

Getting Started

  1. Import the library. go get github.com/lytics/go-lytics
  2. Create a new client from api key.
  3. Run one of the many methods to access account info.
package main

import (
	"fmt"
	"encoding/json"
	
	lytics "github.com/lytics/go-lytics"
)

func main() {
	// set your api key
	key := "<YOUR API KEY>"

	// create the client
	client := lytics.NewLytics(key, nil)

	// create a scanner for All Users in a Segment 
	scan := client.PageSegment(`
		FILTER AND (
		    lastvisit_ts > "now-2d"
		    EXISTS email
		)
		FROM user
	`)

	// handle processing the users
	for {
		e := scan.Next()
		if e == nil {
			break
		}

		by, err := json.Marshal(e.Fields)
		if err != nil {
			fmt.Println("ERROR: ", err)
			continue
		}
		fmt.Println(string(by))
	}
}

Examples

  • Get All Accounts
  • Get All Segments
  • Get Segments A User Belongs To
  • Page Through Users in Segment

Supported Methods

  • Account
    • Single GET
    • All GET
  • Admin User
    • Single GET
    • All GET
  • Segment
    • Single GET
    • All GET
  • Entity (end users) API GET
  • Catalog
    • Schema GET
  • Query
    • All GET
    • Test Evaluation POST

Contributing

Want to add something? Go for it, just fork the repo and send us a PR. Please make sure all tests run go test -v and that all new functionality comes with well documented and thorough testing.

License

MIT Copyright (c) 2018, 2017, 2016, 2015 Lytics

About

Lytics SDK for Go (Golang)

Topics

lio-dependency

Resources

Readme
MIT license
Activity
Custom properties

Stars

5 stars

Watchers

28 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.