seer

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2024 License: BSD-3-Clause Imports: 54 Imported by: 1

Documentation

Index

Constants

View Source
const (
	UsageStatement = `` /* 302-byte string literal not displayed */
	InsertService  = `INSERT OR REPLACE INTO Services(Id, Timestamp, Type) VALUES (?,?,?)`
	InsertMeta     = `INSERT OR REPLACE INTO Meta(Id, Type, Key, Value) VALUES (?,?,?,?)`
	DeleteService  = `DELETE FROM Services WHERE Id=?`
	DeleteMetas    = `DELETE FROM Meta WHERE Id=?`
	GetServiceType = `SELECT Type FROM Services WHERE Id=?`

	CreateServiceTable = `CREATE TABLE IF NOT EXISTS Services (
		"Id" varchar(255),
		"Timestamp" int,
		"Type"  varchar(255),
		UNIQUE(Id, Type)
	);`

	CreateUsageTable = `` /* 482-byte string literal not displayed */

	CreateMetaTable = `` /* 154-byte string literal not displayed */

	GetServiceIp = `SELECT Value from Meta, Usage WHERE Meta.Id = Usage.Id AND Usage.Timestamp > ? AND Key="IP" AND  Type=?;`
)

Variables

View Source
var (
	NodeDatabaseFileName     string = "seer-node-database.db"
	IPKey                           = "IP"
	DefaultBlockTime                = 60 * time.Second
	ValidServiceResponseTime        = 5 * time.Minute
)

Functions

func GetHTTPSServicingNodeIps added in v1.1.0

func GetHTTPSServicingNodeIps(proto string) string

func Package

func Package() config.ProtoCommandIface

Types

type Config

type Config struct {
	config.Node `yaml:"z,omitempty"`
}

type Data

type Data map[string]interface{}

type Options

type Options func(*Service) error

func Resolver

func Resolver(resolver iface.Resolver) Options

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, config *tauConfig.Node, opts ...Options) (*Service, error)

func (*Service) Close

func (srv *Service) Close() error

func (*Service) GitHubTokenHTTPAuth

func (srv *Service) GitHubTokenHTTPAuth(ctx http.Context) (interface{}, error)

func (*Service) GitHubTokenHTTPAuthCleanup

func (srv *Service) GitHubTokenHTTPAuthCleanup(ctx http.Context) (interface{}, error)

func (*Service) KV

func (s *Service) KV() kvdb.KVDB

func (*Service) Node

func (s *Service) Node() peer.Node

func (*Service) Resolver

func (s *Service) Resolver() iface.Resolver

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL