Skip to content

How to add optional attributes? #7

Description

@TobbeEdgeware

This looks like a nice library for manipulating DASH MPDs.

I'm considering using this library for a project similar to https://github.com/dash-Industry-Forum/dash-live-source-simulator in Go, but there are very many MPD nodes and attributes missing before I can use it.

I can make some PRs for the elements I'm missing, but would like to know to understand if you have a strong opinion on how to add optional attributes.

For example, I would like to add contentType to AdaptationSet, and I could either do it as

	ContentType             string           `xml:"contentType,attr,omitempty"`

or

ContentType             *string           `xml:"contentType,attr"`

In my view, the first approach should be more efficient since it avoids one level of pointers, and it is also more clear
(at least to me) that this is an optional attribute. However, I get the impression that you use the pointers like *string to signal that something is optional.

What is your recommendation?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions