sspvo

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

README

go-sspvo

Module for working with Суперсервис "Поступление в ВУЗ онлайн"

Documentation

Index

Constants

View Source
const (
	VERSION = "1.0.0"
)

Variables

View Source
var (
	ErrBadSign = errors.New("crypto: bad sign")
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Send(ctx context.Context, msg Message) (res Response)
}

type ClientResponse

type ClientResponse struct {
	Code   int
	Body   []byte
	Header http.Header
}

type Crypto

type Crypto interface {
	GetVerifyCrypto(cert string) (Crypto, error)
	GetCert() string
	Hash(data []byte) (hash []byte)
	Sign(digest []byte) (sign []byte, err error)
	Verify(sign, digest []byte) (ok bool, err error)
}

type FieldName

type FieldName string
const (
	FieldOGRN     FieldName = "OGRN"
	FieldKPP      FieldName = "KPP"
	FieldCLS      FieldName = "CLS"
	FieldCert     FieldName = "Cert64"
	FieldToken    FieldName = "token"
	FieldAction   FieldName = "action"
	FieldDataType FieldName = "data_type"
	FieldIdJWT    FieldName = "IDJWT"
)

func (FieldName) IsValid

func (e FieldName) IsValid() bool

func (FieldName) String

func (e FieldName) String() string

type Fields

type Fields func(JWTFields)

type JWTFields

type JWTFields map[FieldName]interface{}

type Message

type Message interface {
	UpdateJWTFields(fields ...Fields) Message
	PathMethod() string
	GetJWT() ([]byte, error)
	Response() Response
}

type Response

type Response interface {
	ClientResponse() *ClientResponse
	SetClientResponse(resp *ClientResponse)
	SetError(err error)
	Error() error
	Data() ([]byte, error)
}

type Token

type Token struct {
	Header  string
	Payload string
	Sign    string
}

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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