Categorygithub.com/ironzhang/supernamego
modulepackage
0.0.0-20240912100530-63156deb75d1
Repository: https://github.com/ironzhang/supernamego.git
Documentation: pkg.go.dev

# README

English | 中文

supernamego

Overview

supernamego is a Go client for sns, it supports service discovery like dns.

Quick Start

Requirements

  • go version >= 1.22.3
  • A working docker environment

Installation

see sns Installation

Examples

The following code shows how to use supernamego to resolve sns domain names.

package main

import (
	"context"
	"fmt"

	"github.com/ironzhang/supernamego"
)

func main() {
	err := supernamego.AutoSetup()
	if err != nil {
		fmt.Printf("supernamego auto setup: %v\n", err)
		return
	}

	addr, cluster, err := supernamego.Lookup(context.Background(), "sns/https.myapp")
	if err != nil {
		fmt.Printf("supernamego lookup: %v\n", err)
		return
	}
	fmt.Printf("cluster=%s, address=%v\n", cluster, addr)
}

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AutoSetup 无参初始化.
Lookup 查找地址节点.
No description provided by the author
No description provided by the author

# Type aliases

No description provided by the author