v1dot1

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package v1dot1 contains the type definitions for Icon v1.1.

All types have accessor methods to access fields which can be chained on nils. This makes it possible to easily drill down into deeply nested data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ObjectType

func ObjectType() trv.ObjectType

Types

type Icon

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

func (*Icon) Acknowledged

func (x *Icon) Acknowledged() *time.Time

func (*Icon) Base64

func (x *Icon) Base64() *string

SV: Förhandsgranskning av ikon där bilden representeras som en Base64-enkodad sträng.<br /> En webbläsare kan direkt visa en Base64-enkodad bild utan att behöva göra ett anrop till servern. Detta görs i HTML genom att img-elementets src-attribut inleds med <code>data:image/png;base64,</code> följt av själva datat. Exempel:<br /><pre class="prettyprint">&lt;img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" /&gt;</pre> Resultat: <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" /><br /> Läs mer om Base64 - <a href="http://sv.wikipedia.org/wiki/Base64" target="_blank">http://sv.wikipedia.org/wiki/Base64</a>

func (*Icon) CheckoutID

func (x *Icon) CheckoutID() *string

func (*Icon) Checkouts

func (x *Icon) Checkouts() *int64

func (*Icon) Deleted

func (x *Icon) Deleted() *bool

func (*Icon) Description

func (x *Icon) Description() *string

SV: Kort beskrivning av ikonen

func (*Icon) ID

func (x *Icon) ID() *string

SV: Ikonens id, refereras från andra objekttyper i fältet IconId

func (*Icon) ItemsAcknowledged

func (x *Icon) ItemsAcknowledged() *int64

func (*Icon) ItemsLeft

func (x *Icon) ItemsLeft() *int64

func (*Icon) LeasedUntil

func (x *Icon) LeasedUntil() *time.Time

func (*Icon) ModifiedTime

func (x *Icon) ModifiedTime() *time.Time

EN: Specifies when the object is stored. SV: Anger när objektet är sparat.

func (*Icon) StatusCode

func (x *Icon) StatusCode() *uint8

func (*Icon) URL

func (x *Icon) URL() *string

SV: Url till ikonbilden<br /> Notera att det finns tre olika ikonbilder vilka specifieras med Url-parametern 'type'. Om ingen typ specificeras returneras png32x32.<br /><table class="table table-bordered table-condensed table-striped"><tr class="headerRowClass"><th>type</th><th>Beskrivning</th></tr><tr><td>svg</td><td>Filformat SVG</td></tr><tr><td>png16x16</td><td>Filformat PNG i storlek 16x16 pixlar</td></tr><tr><td>png32x32</td><td>Filformat PNG i storlek 32x32 pixlar</td></tr></table><p> Exempel:<br /> http://api.trafikinfo.trafikverket.se/v1/icons/roadwork?type=png32x32 </p><p> SVG (Scalable Vector Graphics) är ett XML-baserat format för vektorgrafik. En vektorbaserad bild kan skalas upp utan kvalitetsförsämring.<br /> Läs mer om SVG – <a href="http://sv.wikipedia.org/wiki/Scalable_Vector_Graphics" target="_blank">http://sv.wikipedia.org/wiki/Scalable_Vector_Graphics</a></p><p> PNG (Portable Network Graphics) är ett format för icke-fotografiska bilder så som t.ex. ikoner.<br /> Läs mer om PNG– <a href="http://sv.wikipedia.org/wiki/PNG" target="_blank">http://sv.wikipedia.org/wiki/PNG</a></p>

func (*Icon) UnmarshalXML

func (x *Icon) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Response

type Response struct {
	XMLName xml.Name `xml:"RESPONSE"`
	Results []struct {
		Info struct {
			LastModified trv.LastModified `xml:"LASTMODIFIED"`
			LastChangeID string           `xml:"LASTCHANGEID"`
			EvalResult   []any            `xml:"EVALRESULT"`
			SSEURL       string           `xml:"SSEURL"`
		} `xml:"INFO"`
		Error *trv.APIError `xml:"ERROR"`
		Data  []Icon        `xml:"Icon"`
	} `xml:"RESULT"`
}

Response can be used to decode the response from the API.

For example:

package main

import (
	 "encoding/xml"
	 api "code.dny.dev/trafikinfo/trv/icon/v1dot1"
)

func main() {
	var res api.Response
	err := xml.Unmarshal(data, &res)
}

func (Response) ErrorMsg

func (r Response) ErrorMsg() string

Errors returns a slice of trv.Error, if any error was included in the response.

func (Response) HasErrors

func (r Response) HasErrors() bool

HasErrors returns whether any of the results includes an error.

Jump to

Keyboard shortcuts

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