dto

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

View Source
const ANONYMOUS_OWNER = "anonymous"

Variables

This section is empty.

Functions

func ToBody

func ToBody(dto *DtoBody) *body.BodyRequest

func ToCollection

func ToCollection(dto *DtoCollection) *collection.Collection

func ToCollectionNodes

func ToCollectionNodes(dto []DtoNodeCollection) []domain.NodeReference

func ToContext

func ToContext(dto *DtoContext) *context.Context

func ToRequest

func ToRequest(dto *DtoRequest) *action.Request

func ToRequestNodes

func ToRequestNodes(dto []DtoNodeRequest) []domain.NodeReference

func ToRequests

func ToRequests(dtos ...DtoRequest) []action.Request

func ToResponse

func ToResponse(dto *DtoResponse) *action.Response

func ToSession

func ToSession(dto DtoSession) *session.Session

Types

type DtoBody

type DtoBody struct {
	Status      bool                                       `json:"status"`
	ContentType domain.ContentType                         `json:"content_type"`
	Parameters  map[string]map[string][]body.BodyParameter `json:"parameters"`
}

func FromBody

func FromBody(body *body.BodyRequest) *DtoBody

type DtoCollection

type DtoCollection struct {
	Id        string                      `json:"_id"`
	Name      string                      `json:"name"`
	Timestamp int64                       `json:"timestamp"`
	Context   DtoContext                  `json:"context"`
	Nodes     []DtoNodeRequest            `json:"nodes"`
	Owner     string                      `json:"owner"`
	Modified  int64                       `json:"modified"`
	Status    collection.StatusCollection `json:"status"`
}

func FromCollection

func FromCollection(collection *collection.Collection, ctx *DtoContext, nodes []action.NodeRequest) *DtoCollection

type DtoContext

type DtoContext struct {
	Id         string                               `json:"_id"`
	Status     bool                                 `json:"status"`
	Timestamp  int64                                `json:"timestamp"`
	Dictionary map[string]map[string]DtoItemContext `json:"dictionary"`
	Owner      string                               `json:"owner"`
	Modified   int64                                `json:"modified"`
}

func FromContext

func FromContext(ctx *context.Context) *DtoContext

func (DtoContext) PersistenceId

func (c DtoContext) PersistenceId() string

type DtoItemContext

type DtoItemContext struct {
	Order   int64  `json:"order"`
	Private bool   `json:"private"`
	Status  bool   `json:"status"`
	Value   string `json:"value"`
}

type DtoNodeCollection

type DtoNodeCollection struct {
	Order      int           `json:"order"`
	Collection DtoCollection `json:"collection"`
}

type DtoNodeRequest

type DtoNodeRequest struct {
	Order   int        `json:"order"`
	Request DtoRequest `json:"request"`
}

func FromNodeRequest

func FromNodeRequest(nodes []action.NodeRequest) []DtoNodeRequest

type DtoRequest

type DtoRequest struct {
	Id        string               `json:"_id"`
	Timestamp int64                `json:"timestamp"`
	Name      string               `json:"name"`
	Method    domain.HttpMethod    `json:"method"`
	Uri       string               `json:"uri"`
	Query     query.Queries        `json:"query"`
	Header    header.Headers       `json:"header"`
	Cookie    cookie.CookiesClient `json:"cookie"`
	Body      DtoBody              `json:"body"`
	Auth      auth.Auths           `json:"auth"`
	Owner     string               `json:"owner"`
	Modified  int64                `json:"modified"`
	Status    action.StatusRequest `json:"status"`
}

func FromRequest

func FromRequest(request *action.Request) *DtoRequest

func FromRequests

func FromRequests(reqs ...action.Request) []DtoRequest

type DtoResponse

type DtoResponse struct {
	Id        string               `json:"_id"`
	Timestamp int64                `json:"timestamp"`
	Request   string               `json:"request"`
	Date      int64                `json:"date"`
	Time      int64                `json:"time"`
	Status    int16                `json:"status"`
	Headers   header.Headers       `json:"headers"`
	Cookies   cookie.CookiesServer `json:"cookies"`
	Body      body.BodyResponse    `json:"body"`
	Size      int                  `json:"size"`
	Owner     string               `json:"owner"`
}

func FromResponse

func FromResponse(request *action.Response) *DtoResponse

type DtoSession

type DtoSession struct {
	Username  string         `json:"username"`
	Lock      bool           `json:"lock"`
	Secret    string         `json:"secret"`
	Timestamp int64          `json:"timestamp"`
	Publisher string         `json:"publisher"`
	Count     int            `json:"count"`
	Refresh   string         `json:"refresh"`
	Roles     []session.Role `json:"roles"`
}

func FromSession

func FromSession(session session.Session) *DtoSession

func NewDtoSessionDefault

func NewDtoSessionDefault() *DtoSession

func (DtoSession) PersistenceId

func (s DtoSession) PersistenceId() string

Jump to

Keyboard shortcuts

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