nagoyau

package module
v0.0.0-...-a04c1d4 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

README

go-nagoyau

名古屋大学のサービスにログイン済みの*http.Clientを返してくれます

インストール

go get github.com/nu50218/go-nagoyau

使い方

// NewClient servicesで指定した名古屋大学のサービスにログイン済みの*http.Clientを返してくれます
func NewClient(username, password string, services ...Service)

を使います。

たとえば名大ポータルとNUCTにログイン済みの*http.Clientを得たい場合は、以下のようにサービスを指定します。

client, err := nagoyau.NewClient("username", "password", nagoyau.Portal, nagoyau.CT)
対応サービス一覧
サービス Service
名大ポータル nagoyau.Portal
NUCT nagoyau.CT

ログイン時のURLのクエリパラメーターのserviceservice.goに追加し、NewClientswitchの部分を書き足すだけなので、追加したいものがあればPRしてください!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(username, password string, services ...Service) (*http.Client, error)

NewClient servicesで指定した名古屋大学のサービスにログイン済みの*http.Clientを返してくれます

Types

type Service

type Service string

Service 名大ポータルやNUCTなど

const (
	// Portal 名大ポータル
	Portal Service = "https://portal.nagoya-u.ac.jp/login"
	// CT NUCT
	CT Service = "https://ct.nagoya-u.ac.jp/sakai-login-tool/container"
)

Jump to

Keyboard shortcuts

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