dto

package
v0.0.0-...-748ae4c Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: GPL-3.0 Imports: 0 Imported by: 0

README

This package / folder holds data transfer objects.

Also holds the struct used by a mapper for IN & OUT request and responses structs / objects

Documentation

Index

Constants

View Source
const (
	ElectionDocType = "election"
	BallotDocType   = "ballot"
	SectionDocType  = "section"
	UserDocType     = "user"
	ElectionID      = "election-ID1"
	ElectionIndex   = ElectionDocType + ":" + ElectionID
)

docType

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokenData

type AccessTokenData struct {
	Scope  []string
	Claims InjectedParam
}

AccessTokenData using by this REST Api (HLF client node) to grant access to the resources

type Asset

type Asset struct {
	AppraisedValue int    `json:"AppraisedValue"`
	Color          string `json:"Color"`
	ID             string `json:"ID"`
	Owner          string `json:"Owner"`
	Size           int    `json:"Size"`
}

asset de chaincode-go

type Claims

type Claims struct {
	Sub string
	Rol string
}

Claims user claims

type DevPopulateOut

type DevPopulateOut struct {
	TxId     string
	Identity string
}

DevPopulateOut

type GetRequest

type GetRequest struct {
	ID string `json:"id"`
}

type GetUser

type GetUser struct {
	User User `json:"user"`
}

type GrantIntentResponse

type GrantIntentResponse struct {
	Identifier string // if we use `json:"<source_name>"` we can map any source to a common particular / internal struct field as Identifier used here
	DID        string
}

type InjectedParam

type InjectedParam struct {
	Did      string
	Username string
}

type Problem

type Problem struct {
	Status uint   `example:"503"`
	Title  string `example:"err_code"`
	Detail string `example:"Some error details"`
}

Problem api documentation

func NewProblem

func NewProblem(s uint, t string, d string) *Problem

NewProblem construct a new api error struct and return a pointer to it

- s [uint] ~ HTTP status tu respond

- t [string] ~ Title of the error

- d [string] ~ Description or detail of the error

type User

type User struct {
	Id         string `json:"id"`
	Passphrase string `json:"passphrase"`
	Clear      string `json:"clear"`
	Username   string `json:"username"`
	Name       string `json:"name"`
}

User struct

type UserCredIn

type UserCredIn struct {
	Username string `example:"zoro@matcom.uh.cu" validate:"required,ascii,gte=3,lte=60"`
	Password string `example:"my_password" validate:"required,ascii,gte=3,lte=20"`
}

This is a example declaring the validation for teh struct. It will be used when the struct is in the endpoint parameters

type UserList

type UserList struct {
	Users []User `yaml:"Users"`
}

UserList lUser list of yml file based users

type UserRegister

type UserRegister struct {
	ID       string `json:"id"`
	Username string `json:"username"`
}

Jump to

Keyboard shortcuts

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