catalog

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const JDocExchangeFileSchemaVersion = "1.0.0"

Variables

This section is empty.

Functions

func Annotation

func Annotation(s string) string

Types

type Catalog

type Catalog struct {

	// Info represent "INFO" directive structure.
	Info *Info

	// Servers contains information about servers.
	Servers *Servers

	// UserTypes contains information about defined user types.
	UserTypes *UserTypes

	ResourceMethods *ResourceMethods

	Tags *Tags

	JSightVersion string
	// contains filtered or unexported fields
}

func NewCatalog

func NewCatalog() *Catalog

func (*Catalog) AddBaseUrl

func (c *Catalog) AddBaseUrl(serverName string, path string) error

func (*Catalog) AddDescriptionToInfo

func (c *Catalog) AddDescriptionToInfo(text string) error

func (*Catalog) AddDescriptionToMethod

func (c *Catalog) AddDescriptionToMethod(d directive.Directive, text string) error

func (*Catalog) AddInfo

func (c *Catalog) AddInfo(d directive.Directive) error

func (*Catalog) AddJSight

func (c *Catalog) AddJSight(version string) error

func (*Catalog) AddMethod

func (c *Catalog) AddMethod(d directive.Directive) error

func (*Catalog) AddQueryToCurrentMethod

func (c *Catalog) AddQueryToCurrentMethod(d directive.Directive, q Query) error

func (*Catalog) AddRawUserType

func (c *Catalog) AddRawUserType(d *directive.Directive)

func (*Catalog) AddRequest

func (c *Catalog) AddRequest(d directive.Directive) error

func (*Catalog) AddRequestBody

func (c *Catalog) AddRequestBody(s Schema, f SerializeFormat, d directive.Directive) error

func (*Catalog) AddRequestHeaders

func (c *Catalog) AddRequestHeaders(s Schema, d directive.Directive) error

func (*Catalog) AddResponse

func (c *Catalog) AddResponse(code string, annotation string, d directive.Directive) error

func (*Catalog) AddResponseBody

func (c *Catalog) AddResponseBody(
	schemaName string,
	schemaBytes bytes.Bytes,
	bodyFormat SerializeFormat,
	sn notation.SchemaNotation,
	d directive.Directive,
	tt *UserSchemas,
) *jerr.JAPIError

func (*Catalog) AddResponseHeaders

func (c *Catalog) AddResponseHeaders(s Schema, d directive.Directive) error

func (*Catalog) AddServer

func (c *Catalog) AddServer(name string, annotation string) error

func (*Catalog) AddTitle

func (c *Catalog) AddTitle(name string) error

func (*Catalog) AddType

func (c *Catalog) AddType(
	d directive.Directive,
	tt *UserSchemas,
) *jerr.JAPIError

func (*Catalog) AddVersion

func (c *Catalog) AddVersion(version string) error

func (*Catalog) GetRawUserTypes

func (c *Catalog) GetRawUserTypes() *directive.Directives

func (*Catalog) MarshalJSON

func (c *Catalog) MarshalJSON() ([]byte, error)

func (*Catalog) Read

func (*Catalog) Read(coords directive.Coords) bytes.Bytes

func (*Catalog) ToJson

func (c *Catalog) ToJson() ([]byte, error)

func (*Catalog) ToJsonIndent

func (c *Catalog) ToJsonIndent() ([]byte, error)

type HTTPRequest

type HTTPRequest struct {
	*HTTPRequestHeaders `json:"headers,omitempty"`
	*HTTPRequestBody    `json:"body,omitempty"`
	Directive           directive.Directive `json:"-"`
}

type HTTPRequestBody

type HTTPRequestBody struct {
	Format    SerializeFormat     `json:"format"`
	Schema    *Schema             `json:"schema"`
	Directive directive.Directive `json:"-"`
}

type HTTPRequestHeaders

type HTTPRequestHeaders struct {
	Schema    *Schema             `json:"schema"`
	Directive directive.Directive `json:"-"`
}

type HTTPResponse

type HTTPResponse struct {
	Code       string               `json:"code"`
	Annotation string               `json:"annotation,omitempty"`
	Headers    *HTTPResponseHeaders `json:"headers,omitempty"`
	Body       *HTTPResponseBody    `json:"body"`
	Directive  directive.Directive  `json:"-"`
}

type HTTPResponseBody

type HTTPResponseBody struct {
	Format    SerializeFormat     `json:"format"`
	Schema    *Schema             `json:"schema"`
	Directive directive.Directive `json:"-"`
}

type HTTPResponseHeaders

type HTTPResponseHeaders struct {
	Schema    *Schema             `json:"schema"`
	Directive directive.Directive `json:"-"`
}

type Info

type Info struct {
	Title       string              `json:"title,omitempty"`
	Version     string              `json:"version,omitempty"`
	Description *string             `json:"description,omitempty"`
	Directive   directive.Directive `json:"-"`
}

Info general info about api

type Method

type Method uint8
const (
	GET Method = iota
	POST
	PUT
	PATCH
	DELETE
	OPTIONS
)

func NewMethod

func NewMethod(de directive.Enumeration) (Method, error)

func (Method) MarshalText

func (e Method) MarshalText() ([]byte, error)

func (Method) String

func (e Method) String() string

type OrderedResources

type OrderedResources []Resource

func (OrderedResources) MarshalJSON

func (oo OrderedResources) MarshalJSON() ([]byte, error)

type Path

type Path string

func (Path) String

func (p Path) String() string

type PathVariables

type PathVariables struct {
	Schema Schema `json:"schema"`
}

type Properties

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

Properties represent JSight object properties. gen:OrderedMap

func NewProperties

func NewProperties(data map[string]*SchemaContentJSight, order []string) *Properties

func (*Properties) Each

func (m *Properties) Each(fn eachPropertiesFunc) error

Each iterates and perform given function on each item in the map.

func (*Properties) EachReverse

func (m *Properties) EachReverse(fn eachPropertiesFunc) error

EachReverse act almost the same as Each but in reverse order.

func (*Properties) EachSafe

func (m *Properties) EachSafe(fn eachSafePropertiesFunc)

func (*Properties) Find

func (m *Properties) Find(fn findPropertiesFunc) (PropertiesItem, bool)

Find finds first matched item from the map.

func (*Properties) Get

func (m *Properties) Get(k string) (*SchemaContentJSight, bool)

Get gets a value by key.

func (*Properties) GetValue

func (m *Properties) GetValue(k string) *SchemaContentJSight

GetValue gets a value by key.

func (*Properties) Has

func (m *Properties) Has(k string) bool

Has checks that specified key is set.

func (*Properties) Len

func (m *Properties) Len() int

Len returns count of values.

func (*Properties) Map

func (m *Properties) Map(fn mapPropertiesFunc) error

Map iterates and changes values in the map.

func (*Properties) MarshalJSON

func (m *Properties) MarshalJSON() ([]byte, error)

func (*Properties) Set

func (m *Properties) Set(k string, v *SchemaContentJSight)

Set sets a value with specified key.

func (*Properties) SetToTop

func (m *Properties) SetToTop(k string, v *SchemaContentJSight)

SetToTop do the same as Set, but new key will be placed on top of the order map.

func (*Properties) Update

func (m *Properties) Update(k string, fn func(v *SchemaContentJSight) *SchemaContentJSight)

Update updates a value with specified key.

type PropertiesItem

type PropertiesItem struct {
	Key   string
	Value *SchemaContentJSight
}

PropertiesItem represent single data from the Properties.

type Query

type Query struct {
	Example   string              `json:"example,omitempty"`
	Format    string              `json:"format"`
	Schema    *Schema             `json:"schema"`
	Directive directive.Directive `json:"-"`
}

func NewQuery

func NewQuery(d directive.Directive) Query

type Resource

type Resource struct {
	Val *ResourceMethod
	Key ResourceMethodId
}

type ResourceMethod

type ResourceMethod struct {
	Path          Path           `json:"path"`
	Tags          []TagName      `json:"tags"`
	PathVariables *PathVariables `json:"pathVariables,omitempty"`
	Annotation    string         `json:"annotation,omitempty"`
	Description   *string        `json:"description,omitempty"`
	Query         *Query         `json:"query,omitempty"`
	Request       *HTTPRequest   `json:"request,omitempty"`
	Responses     []HTTPResponse `json:"responses,omitempty"`
	HttpMethod    Method         `json:"httpMethod"`
}

type ResourceMethodId

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

func (ResourceMethodId) MarshalText

func (r ResourceMethodId) MarshalText() ([]byte, error)

func (ResourceMethodId) String

func (r ResourceMethodId) String() string

type ResourceMethodIdList

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

func (ResourceMethodIdList) MarshalJSON

func (l ResourceMethodIdList) MarshalJSON() ([]byte, error)

type ResourceMethods

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

ResourceMethods represent available resource methods. gen:OrderedMap

func (*ResourceMethods) Each

func (m *ResourceMethods) Each(fn eachResourceMethodsFunc) error

Each iterates and perform given function on each item in the map.

func (*ResourceMethods) EachReverse

func (m *ResourceMethods) EachReverse(fn eachResourceMethodsFunc) error

EachReverse act almost the same as Each but in reverse order.

func (*ResourceMethods) EachSafe

func (m *ResourceMethods) EachSafe(fn eachSafeResourceMethodsFunc)

func (*ResourceMethods) Find

func (m *ResourceMethods) Find(fn findResourceMethodsFunc) (ResourceMethodsItem, bool)

Find finds first matched item from the map.

func (*ResourceMethods) Get

Get gets a value by key.

func (*ResourceMethods) GetValue

GetValue gets a value by key.

func (*ResourceMethods) Has

Has checks that specified key is set.

func (*ResourceMethods) Len

func (m *ResourceMethods) Len() int

Len returns count of values.

func (*ResourceMethods) Map

func (m *ResourceMethods) Map(fn mapResourceMethodsFunc) error

Map iterates and changes values in the map.

func (*ResourceMethods) MarshalJSON

func (m *ResourceMethods) MarshalJSON() ([]byte, error)

func (*ResourceMethods) Set

Set sets a value with specified key.

func (*ResourceMethods) SetToTop

func (m *ResourceMethods) SetToTop(k ResourceMethodId, v *ResourceMethod)

SetToTop do the same as Set, but new key will be placed on top of the order map.

func (*ResourceMethods) Update

Update updates a value with specified key.

type ResourceMethodsItem

type ResourceMethodsItem struct {
	Key   ResourceMethodId
	Value *ResourceMethod
}

ResourceMethodsItem represent single data from the ResourceMethods.

type Rule

type Rule struct {
	JsonType    string
	ScalarValue string
	Note        string
	Properties  *Rules
	Items       []Rule
}

func (Rule) MarshalJSON

func (r Rule) MarshalJSON() ([]byte, error)

type Rules

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

Rules represent JSight rules. gen:OrderedMap

func NewRules

func NewRules(data map[string]Rule, order []string) *Rules

func (*Rules) Each

func (m *Rules) Each(fn eachRulesFunc) error

Each iterates and perform given function on each item in the map.

func (*Rules) EachReverse

func (m *Rules) EachReverse(fn eachRulesFunc) error

EachReverse act almost the same as Each but in reverse order.

func (*Rules) EachSafe

func (m *Rules) EachSafe(fn eachSafeRulesFunc)

func (*Rules) Find

func (m *Rules) Find(fn findRulesFunc) (RulesItem, bool)

Find finds first matched item from the map.

func (*Rules) Get

func (m *Rules) Get(k string) (Rule, bool)

Get gets a value by key.

func (*Rules) GetValue

func (m *Rules) GetValue(k string) Rule

GetValue gets a value by key.

func (*Rules) Has

func (m *Rules) Has(k string) bool

Has checks that specified key is set.

func (*Rules) Len

func (m *Rules) Len() int

Len returns count of values.

func (*Rules) Map

func (m *Rules) Map(fn mapRulesFunc) error

Map iterates and changes values in the map.

func (*Rules) MarshalJSON

func (m *Rules) MarshalJSON() ([]byte, error)

func (*Rules) Set

func (m *Rules) Set(k string, v Rule)

Set sets a value with specified key.

func (*Rules) SetToTop

func (m *Rules) SetToTop(k string, v Rule)

SetToTop do the same as Set, but new key will be placed on top of the order map.

func (*Rules) Update

func (m *Rules) Update(k string, fn func(v Rule) Rule)

Update updates a value with specified key.

type RulesItem

type RulesItem struct {
	Key   string
	Value Rule
}

RulesItem represent single data from the Rules.

type Schema

type Schema struct {
	// Notation used notation for this schema.
	Notation notation.SchemaNotation

	// ContentJSight a JSight schema.
	ContentJSight *SchemaContentJSight
	// UsedUserTypes a list of used user types.
	UsedUserTypes *StringSet
	// UserUserTypes a list of used user enums.
	UsedUserEnums *StringSet

	// ContentRegexp a regular expression.
	ContentRegexp string
}

Schema represent a user defined schema.

func NewRegexSchema

func NewRegexSchema(regexStr bytes.Bytes) Schema

func NewSchema

func NewSchema(n notation.SchemaNotation) Schema

func UnmarshalSchema

func UnmarshalSchema(name string, b []byte, userTypes *UserSchemas) (_ Schema, err error)

UnmarshalSchema unmarshal a schema from the given slice of bytes. Marshaled schema shouldn't contain any trailing symbols.

func (Schema) MarshalJSON

func (schema Schema) MarshalJSON() ([]byte, error)

type SchemaContentJSight

type SchemaContentJSight struct {
	// JsonType a JSON type.
	JsonType string

	// Type a JSight type.
	Type string

	// ScalarValue contains scalar value from the example.
	// Make sense only for scalar types like string, integer, and etc.
	ScalarValue string

	// InheritedFrom a user defined type from which this property is inherited.
	InheritedFrom string

	// Note a user note.
	Note string

	// Rules a list of attached rules.
	Rules *Rules

	// Properties represent available object properties.
	// Make sense only when Type is "object".
	Properties *Properties

	// Items represent available array items.
	// Make sense only when Type is "array".
	Items []*SchemaContentJSight

	// IsKeyShortcut indicates that this is an object property which is described
	// by user defined type.
	IsKeyShortcut bool

	// Optional indicates that this schema item is option or not.
	Optional bool
}

func (SchemaContentJSight) MarshalJSON

func (c SchemaContentJSight) MarshalJSON() (b []byte, err error)

type SerializeFormat

type SerializeFormat string
const (
	SerializeFormatJSON        SerializeFormat = "json"
	SerializeFormatPlainString SerializeFormat = "plainString"
	SerializeFormatBinary      SerializeFormat = "binary"
)

func SchemaSerializeFormat

func SchemaSerializeFormat(n notation.SchemaNotation) (SerializeFormat, error)

type Server

type Server struct {
	BaseUrlVariables *baseUrlVariables `json:"baseUrlVariables,omitempty"`
	Annotation       string            `json:"annotation,omitempty"`
	BaseUrl          string            `json:"baseUrl"`
}

type Servers

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

Servers represent available servers. gen:OrderedMap

func (*Servers) Each

func (m *Servers) Each(fn eachServersFunc) error

Each iterates and perform given function on each item in the map.

func (*Servers) EachReverse

func (m *Servers) EachReverse(fn eachServersFunc) error

EachReverse act almost the same as Each but in reverse order.

func (*Servers) EachSafe

func (m *Servers) EachSafe(fn eachSafeServersFunc)

func (*Servers) Find

func (m *Servers) Find(fn findServersFunc) (ServersItem, bool)

Find finds first matched item from the map.

func (*Servers) Get

func (m *Servers) Get(k string) (*Server, bool)

Get gets a value by key.

func (*Servers) GetValue

func (m *Servers) GetValue(k string) *Server

GetValue gets a value by key.

func (*Servers) Has

func (m *Servers) Has(k string) bool

Has checks that specified key is set.

func (*Servers) Len

func (m *Servers) Len() int

Len returns count of values.

func (*Servers) Map

func (m *Servers) Map(fn mapServersFunc) error

Map iterates and changes values in the map.

func (*Servers) MarshalJSON

func (m *Servers) MarshalJSON() ([]byte, error)

func (*Servers) Set

func (m *Servers) Set(k string, v *Server)

Set sets a value with specified key.

func (*Servers) SetToTop

func (m *Servers) SetToTop(k string, v *Server)

SetToTop do the same as Set, but new key will be placed on top of the order map.

func (*Servers) Update

func (m *Servers) Update(k string, fn func(v *Server) *Server)

Update updates a value with specified key.

type ServersItem

type ServersItem struct {
	Key   string
	Value *Server
}

ServersItem represent single data from the Servers.

type StringSet

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

StringSet a set of strings. gen:Set

func NewStringSet

func NewStringSet(vv ...string) *StringSet

func (*StringSet) Add

func (m *StringSet) Add(v string)

Add adds specific value to set.

func (*StringSet) Data

func (m *StringSet) Data() []string

Data return set's data.

func (*StringSet) Has

func (m *StringSet) Has(v string) bool

Has checks that specified value is exists.

func (*StringSet) Len

func (m *StringSet) Len() int

Len returns len of set.

type Tag

type Tag struct {
	ResourceMethods *TagResourceMethods
	Children        *Tags
	Name            TagName
	Title           string
	Description     string
}

func (*Tag) MarshalJSON

func (t *Tag) MarshalJSON() ([]byte, error)

type TagName

type TagName string

func (TagName) MarshalText

func (t TagName) MarshalText() ([]byte, error)

type TagResourceMethods

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

TagResourceMethods represent available resource methods for the tag. gen:OrderedMap

func (*TagResourceMethods) Each

func (m *TagResourceMethods) Each(fn eachTagResourceMethodsFunc) error

Each iterates and perform given function on each item in the map.

func (*TagResourceMethods) EachReverse

func (m *TagResourceMethods) EachReverse(fn eachTagResourceMethodsFunc) error

EachReverse act almost the same as Each but in reverse order.

func (*TagResourceMethods) EachSafe

func (m *TagResourceMethods) EachSafe(fn eachSafeTagResourceMethodsFunc)

func (*TagResourceMethods) Find

func (m *TagResourceMethods) Find(fn findTagResourceMethodsFunc) (TagResourceMethodsItem, bool)

Find finds first matched item from the map.

func (*TagResourceMethods) Get

Get gets a value by key.

func (*TagResourceMethods) GetValue

GetValue gets a value by key.

func (*TagResourceMethods) Has

func (m *TagResourceMethods) Has(k Path) bool

Has checks that specified key is set.

func (*TagResourceMethods) Len

func (m *TagResourceMethods) Len() int

Len returns count of values.

func (*TagResourceMethods) Map

func (m *TagResourceMethods) Map(fn mapTagResourceMethodsFunc) error

Map iterates and changes values in the map.

func (*TagResourceMethods) MarshalJSON

func (m *TagResourceMethods) MarshalJSON() ([]byte, error)

func (*TagResourceMethods) Set

Set sets a value with specified key.

func (*TagResourceMethods) SetToTop

func (m *TagResourceMethods) SetToTop(k Path, v *ResourceMethodIdList)

SetToTop do the same as Set, but new key will be placed on top of the order map.

func (*TagResourceMethods) Update

Update updates a value with specified key.

type TagResourceMethodsItem

type TagResourceMethodsItem struct {
	Key   Path
	Value *ResourceMethodIdList
}

TagResourceMethodsItem represent single data from the TagResourceMethods.

type Tags

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

Tags represent available tags. gen:OrderedMap

func (*Tags) Each

func (m *Tags) Each(fn eachTagsFunc) error

Each iterates and perform given function on each item in the map.

func (*Tags) EachReverse

func (m *Tags) EachReverse(fn eachTagsFunc) error

EachReverse act almost the same as Each but in reverse order.

func (*Tags) EachSafe

func (m *Tags) EachSafe(fn eachSafeTagsFunc)

func (*Tags) Find

func (m *Tags) Find(fn findTagsFunc) (TagsItem, bool)

Find finds first matched item from the map.

func (*Tags) Get

func (m *Tags) Get(k TagName) (*Tag, bool)

Get gets a value by key.

func (*Tags) GetValue

func (m *Tags) GetValue(k TagName) *Tag

GetValue gets a value by key.

func (*Tags) Has

func (m *Tags) Has(k TagName) bool

Has checks that specified key is set.

func (*Tags) Len

func (m *Tags) Len() int

Len returns count of values.

func (*Tags) Map

func (m *Tags) Map(fn mapTagsFunc) error

Map iterates and changes values in the map.

func (*Tags) MarshalJSON

func (m *Tags) MarshalJSON() ([]byte, error)

func (*Tags) Set

func (m *Tags) Set(k TagName, v *Tag)

Set sets a value with specified key.

func (*Tags) SetToTop

func (m *Tags) SetToTop(k TagName, v *Tag)

SetToTop do the same as Set, but new key will be placed on top of the order map.

func (*Tags) Update

func (m *Tags) Update(k TagName, fn func(v *Tag) *Tag)

Update updates a value with specified key.

type TagsItem

type TagsItem struct {
	Key   TagName
	Value *Tag
}

TagsItem represent single data from the Tags.

type UserSchemas

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

UserSchemas represent available user type's schemas. gen:UnsafeOrderedMap

func (*UserSchemas) Each

func (m *UserSchemas) Each(fn eachUserSchemasFunc) error

Each iterates and perform given function on each item in the map.

func (*UserSchemas) Get

func (m *UserSchemas) Get(k string) (jschema.Schema, bool)

Get gets a value by key.

func (*UserSchemas) GetValue

func (m *UserSchemas) GetValue(k string) jschema.Schema

GetValue gets a value by key.

func (*UserSchemas) Has

func (m *UserSchemas) Has(k string) bool

Has checks that specified key is set.

func (*UserSchemas) Len

func (m *UserSchemas) Len() int

Len returns count of values.

func (*UserSchemas) Map

func (m *UserSchemas) Map(fn mapUserSchemasFunc) error

Map iterates and changes values in the map.

func (*UserSchemas) MarshalJSON

func (m *UserSchemas) MarshalJSON() ([]byte, error)

func (*UserSchemas) Set

func (m *UserSchemas) Set(k string, v jschema.Schema)

Set sets a value with specified key.

func (*UserSchemas) Update

func (m *UserSchemas) Update(k string, fn func(v jschema.Schema) jschema.Schema)

Update updates a value with specified key.

type UserSchemasItem

type UserSchemasItem struct {
	Key   string
	Value jschema.Schema
}

UserSchemasItem represent single data from the UserSchemas.

type UserType

type UserType struct {
	Annotation  string              `json:"annotation,omitempty"`
	Description string              `json:"description,omitempty"`
	Schema      Schema              `json:"schema"`
	Directive   directive.Directive `json:"-"`
}

type UserTypes

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

UserTypes represent available user types. gen:OrderedMap

func (*UserTypes) Each

func (m *UserTypes) Each(fn eachUserTypesFunc) error

Each iterates and perform given function on each item in the map.

func (*UserTypes) EachReverse

func (m *UserTypes) EachReverse(fn eachUserTypesFunc) error

EachReverse act almost the same as Each but in reverse order.

func (*UserTypes) EachSafe

func (m *UserTypes) EachSafe(fn eachSafeUserTypesFunc)

func (*UserTypes) Find

func (m *UserTypes) Find(fn findUserTypesFunc) (UserTypesItem, bool)

Find finds first matched item from the map.

func (*UserTypes) Get

func (m *UserTypes) Get(k string) (*UserType, bool)

Get gets a value by key.

func (*UserTypes) GetValue

func (m *UserTypes) GetValue(k string) *UserType

GetValue gets a value by key.

func (*UserTypes) Has

func (m *UserTypes) Has(k string) bool

Has checks that specified key is set.

func (*UserTypes) Len

func (m *UserTypes) Len() int

Len returns count of values.

func (*UserTypes) Map

func (m *UserTypes) Map(fn mapUserTypesFunc) error

Map iterates and changes values in the map.

func (*UserTypes) MarshalJSON

func (m *UserTypes) MarshalJSON() ([]byte, error)

func (*UserTypes) Set

func (m *UserTypes) Set(k string, v *UserType)

Set sets a value with specified key.

func (*UserTypes) SetToTop

func (m *UserTypes) SetToTop(k string, v *UserType)

SetToTop do the same as Set, but new key will be placed on top of the order map.

func (*UserTypes) Update

func (m *UserTypes) Update(k string, fn func(v *UserType) *UserType)

Update updates a value with specified key.

type UserTypesItem

type UserTypesItem struct {
	Key   string
	Value *UserType
}

UserTypesItem represent single data from the UserTypes.

Jump to

Keyboard shortcuts

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