swetest

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2017 License: MIT Imports: 3 Imported by: 0

README

go-swetest

go-swetest is the simple wrapper of swisseph library's swetest.

GoDoc Go Report Card Build Status Coverage Status

Installation

go get -u github.com/DestinyLab/go-swetest

Usage

You can download the ephemeris files to specifically directory (default same as binary).

package main

import (
	"fmt"
	"log"

	"github.com/DestinyLab/go-swetest"
)

func main() {
	opt := []string{
    "-edir./resources/",
		"-b11.11.2017",
		"-ut00:00:00",
		"-p0",
		"-fZ",
		"-eswe",
		"-head",
	}
	s := swetest.New()
	res, err := s.Query(opt)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%s", res)
}

More Info

Documentation

Overview

Package swetest is the simple wrapper of swisseph library's swetest.

Swetest:

test page: http://www.astro.com/swisseph/swetest.htm
Help: http://www.astro.com/cgi/swetest.cgi?arg=-h&p=0
ephemeris files: ftp://ftp.astro.com/pub/swisseph/ephe/

Example:

package main

import (
	"fmt"
	"log"

	"github.com/DestinyLab/go-swetest"
)

func main() {
	opt := []string{
		"-edir./resources/",
		"-b11.11.2017",
		"-ut00:00:00",
		"-p0",
		"-fZ",
		"-eswe",
		"-head",
	}
	s := swetest.New()
	res, err := s.Query(opt)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%s", res)
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Swetest

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

A Swetest returns what you queryed to swisseph library's swetest.

func New

func New() *Swetest

New creates an instance of swetest.

func (*Swetest) Query

func (s *Swetest) Query(q []string) ([]byte, error)

Query query what you want.

func (*Swetest) SetBinPath

func (s *Swetest) SetBinPath(p string)

SetBinPath set the path to swetest(executable binary).

Jump to

Keyboard shortcuts

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