spiderman

package module
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: MIT Imports: 6 Imported by: 0

README

Installation

go get github.com/nanguohuakai/spiderman

Usage Example

sso

conf := dto.AppConf{
		ServiceName: "",
		Token:       "",
	}
s,_ :=NewSpiderman(conf)

ssoConf := dto.SsoConf{
		BaseUri:     "",
		AppId:       "",
		AppKey:      "",
	}
sso, _ := s.Sso(ssoConf)
r,err := sso.Verify("")

pizza

conf := dto.AppConf{
		ServiceName: "",
		Token:       "",
	}
s,_ :=NewSpiderman(conf)

pizzaConf := dto.SsoConf{
		BaseUri:     "",
	}
pizza, _ := s.pizza(pizzaConf)
var input dto.EmployeeListInput
r,err := pizza.GetEmployeeList(input)

Documentation

Overview

spiderman client

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Spiderman

type Spiderman interface {
	Alert(conf dto.AlertConf) (alert.AlertInterface, error)             //Alert 消息服务
	Pizza(conf dto.PizzaConf) (pizza.PizzaInterface, error)             //Pizza pizza服务
	Schedule(conf dto.ScheduleConf) (schedule.ScheduleInterface, error) //Schedule 定时任务调度服务
	Sso(conf dto.SsoConf) (sso.SsoInterface, error)                     //Sso sso服务
}

Spiderman support pipelining using the Pizza, Sso, Schedule and Alert methods

func NewSpiderman

func NewSpiderman(conf dto.AppConf) (Spiderman, error)

The NewSpiderman interface is the primary interface for working with Spiderman

Example

NewSpiderman

//app conf
conf := dto.AppConf{
	ServiceName: "test",
	Token:       "example",
}
s, _ := NewSpiderman(conf)
fmt.Println(s)
Output:

type SpidermanClient

type SpidermanClient struct {
	AppConf dto.AppConf
}

func (*SpidermanClient) Alert

func (receiver *SpidermanClient) Alert(conf dto.AlertConf) (alert.AlertInterface, error)

Alert store alert service

Example
conf := dto.AppConf{
	ServiceName: "test",
	Token:       "example",
}
spiderman, _ := NewSpiderman(conf)

alertConf := dto.AlertConf{
	BaseUri: "127.0.0.1",
	Level:   "warn",
	Env:     "test",
}

alert, _ := spiderman.Alert(alertConf)
fmt.Println(alert)
Output:

func (*SpidermanClient) Pizza

func (receiver *SpidermanClient) Pizza(conf dto.PizzaConf) (pizza.PizzaInterface, error)

Pizza store pizza service

Example
conf := dto.AppConf{
	ServiceName: "test",
	Token:       "example",
}
spiderman, _ := NewSpiderman(conf)

pizzaConf := dto.PizzaConf{
	BaseUri: "127.0.0.1",
}

pizza, _ := spiderman.Pizza(pizzaConf)
fmt.Println(pizza)
Output:

func (*SpidermanClient) Schedule

func (receiver *SpidermanClient) Schedule(conf dto.ScheduleConf) (schedule.ScheduleInterface, error)

Schedule store schedule service

Example
conf := dto.AppConf{
	ServiceName: "test",
	Token:       "example",
}
spiderman, _ := NewSpiderman(conf)

schedule, _ := spiderman.Schedule(dto.ScheduleConf{
	BaseUri:     "http://127.0.0.1:8081",
	CallbackUri: "http://127.0.0.1:8080",
})
fmt.Println(schedule)
Output:

func (*SpidermanClient) Sso

func (receiver *SpidermanClient) Sso(conf dto.SsoConf) (sso.SsoInterface, error)

Sso store sso service

Example
conf := dto.AppConf{
	ServiceName: "test",
	Token:       "example",
}
spiderman, _ := NewSpiderman(conf)
ssoConf := dto.SsoConf{
	BaseUri: "127.0.0.1",
	AppId:   "test",
	AppKey:  "test1",
}
sso, _ := spiderman.Sso(ssoConf)
fmt.Println(sso)
Output:

Directories

Path Synopsis
core
sso
pkg

Jump to

Keyboard shortcuts

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