uc

package
v0.0.0-...-1d6d57a Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeToken

func DecodeToken(cfe ClientIfe, token string) (*common.SessionData, error)

func GetCluster

func GetCluster(cfe ClientIfe) func(http.ResponseWriter, *http.Request, httprouter.Params)

func Redirect

func Redirect(cfe ClientIfe, w http.ResponseWriter)

func Register

func Register(cfe ClientIfe)

func SetCookie

func SetCookie(cfe ClientIfe, w http.ResponseWriter, session *common.SessionData)

Types

type ClientIfe

type ClientIfe interface {
	SetSSO(string, string, string, string)
	GetProp() map[string]string
}

type LoginData

type LoginData struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type SDK

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

func (*SDK) HttpCheckPassword

func (s *SDK) HttpCheckPassword(username string, password string) (bool, error)

func (*SDK) HttpGet

func (s *SDK) HttpGet(username string) (*UserData, error)

func (*SDK) RPCCheckPassword

func (s *SDK) RPCCheckPassword(username string, password string) (bool, error)

func (*SDK) RPCGet

func (s *SDK) RPCGet(username string) (*UserData, error)

func (*SDK) SetServ

func (s *SDK) SetServ(url string)

type SessionData

type SessionData struct {
	Id   string `json:"id" bson:"_id"`
	Name string `json:"name"`
}

type UCServer

type UCServer struct {
	Pages *webserv.Pages
	// contains filtered or unexported fields
}

func NewServer

func NewServer(database *mgo.Database, file string, rsa *common.RSA) *UCServer

func (*UCServer) CheckPassword

func (s *UCServer) CheckPassword(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*UCServer) Create

func (s *UCServer) Create(w http.ResponseWriter, r *http.Request, parms httprouter.Params)

func (*UCServer) Delete

func (s *UCServer) Delete(w http.ResponseWriter, r *http.Request, parms httprouter.Params)

func (*UCServer) GetClients

func (s *UCServer) GetClients(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*UCServer) GetProp

func (s *UCServer) GetProp() map[string]string

func (*UCServer) Login

func (*UCServer) LoginPage

func (s *UCServer) LoginPage(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*UCServer) RPC

func (*UCServer) RPCCheckPassword

func (s *UCServer) RPCCheckPassword(logindata LoginData, reply *bool) error

func (*UCServer) RPCRSA

func (s *UCServer) RPCRSA(_ string, reply *string) error

func (*UCServer) RPCRegister

func (s *UCServer) RPCRegister(user UserData, reply *bool) error

func (*UCServer) RPCSearch

func (s *UCServer) RPCSearch(key string, reply *UserDataNoPassword) error

func (*UCServer) RPCUpdate

func (s *UCServer) RPCUpdate(user UserDataNoPassword, reply *bool) error

func (*UCServer) RSA

func (*UCServer) Register

func (s *UCServer) Register(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*UCServer) RegisterPage

func (s *UCServer) RegisterPage(w http.ResponseWriter, _ *http.Request, _ httprouter.Params)

func (*UCServer) Run

func (s *UCServer) Run(port string)

func (*UCServer) SSODecodeToken

func (s *UCServer) SSODecodeToken(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*UCServer) SSOIndex

func (s *UCServer) SSOIndex(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

func (*UCServer) Search

func (s *UCServer) Search(w http.ResponseWriter, r *http.Request, param httprouter.Params)

func (*UCServer) SetSSO

func (s *UCServer) SetSSO(sername string, sname string, ssourl string, domain string)

func (*UCServer) Start

func (s *UCServer) Start(port string)

func (*UCServer) Update

func (s *UCServer) Update(w http.ResponseWriter, r *http.Request, parms httprouter.Params)

type UpdateData

type UpdateData struct {
	NewPassword string `json:"new_password"`
	OldPassword string `json:"old_password"`
}

type UserData

type UserData struct {
	Id       string `json:"id" bson:"_id"`
	Name     string `json:"name" bson:"name"`
	Phone    string `json:"phone" bson:"phone"`
	EMail    string `json:"email" bson:"email"`
	Password string `json:"password" bson:"password"`
}

type UserDataNoPassword

type UserDataNoPassword struct {
	Id    string `json:"id" bson:"_id"`
	Name  string `json:"name" bson:"name"`
	Phone string `json:"phone" bson:"phone"`
	EMail string `json:"email" bson:"email"`
}

type UserIndex

type UserIndex struct {
	Id     string `json:"id" bson:"_id"`
	Type   string `json:"type" bson:"type"`
	UserId string `json:"user_id" bson:"user_id"`
}

Jump to

Keyboard shortcuts

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