Skip to content

Add example in the project. #13

@tzzed

Description

@tzzed

Hi Guys congrats again.

I suggest to add a package with an example and mentionne it in the README file. something like this.

import (
	"fmt"
	"log"
	"os"

	"github.com/phoops/ngsiv2/client"
)

func main() {
	url := os.Getenv("ORION_BROKER")
	cli, err := client.NewNgsiV2Client(client.SetUrl(url))
	if err != nil {
		log.Fatalln(err)
	}

	e, err := cli.RetrieveEntity("urn:ngsi-ld:Product:001", client.RetrieveEntitySetType("Product"))
	if err != nil {
		log.Fatalln(err)
	}
	
	b, _ := e.MarshalJSON()
	fmt.Println(string(b))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions