meta

package
v0.0.0-...-e613b9d Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name() string

Name returns a name.

func Set

func Set(v *Meta) error

Set sets a meta data.

func Yaml

func Yaml() (string, error)

Yaml returns Meta as YAML.

func ZerologObject

func ZerologObject() zerolog.LogObjectMarshaler

ZerologObject returns a MarshalZerologObject.

Types

type Meta

type Meta struct {
	Name                 string    `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Semver               string    `protobuf:"bytes,2,opt,name=semver,proto3" json:"semver,omitempty"`
	Channel              string    `protobuf:"bytes,3,opt,name=channel,proto3" json:"channel,omitempty"`
	Runtime              *Runtime  `protobuf:"bytes,4,opt,name=runtime,proto3" json:"runtime,omitempty"`
	Serial               string    `protobuf:"bytes,5,opt,name=serial,proto3" json:"serial,omitempty"`
	Build                time.Time `protobuf:"bytes,6,opt,name=build,proto3" json:"build,omitempty"`
	Vcs                  *Vcs      `protobuf:"bytes,7,opt,name=vcs,proto3" json:"vcs,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-" yaml:"-"`
	XXX_unrecognized     []byte    `json:"-" yaml:"-"`
	XXX_sizecache        int32     `json:"-" yaml:"-"`
}

Meta is ValueObject of meta infomation

func Get

func Get() Meta

Get returns a Meta.

func (*Meta) Descriptor

func (*Meta) Descriptor() ([]byte, []int)

func (Meta) Flatten

func (m Meta) Flatten() map[string]interface{}

func (*Meta) GetBuild

func (m *Meta) GetBuild() time.Time

func (*Meta) GetChannel

func (m *Meta) GetChannel() string

func (*Meta) GetName

func (m *Meta) GetName() string

func (*Meta) GetRuntime

func (m *Meta) GetRuntime() *Runtime

func (*Meta) GetSemver

func (m *Meta) GetSemver() string

func (*Meta) GetSerial

func (m *Meta) GetSerial() string

func (*Meta) GetVcs

func (m *Meta) GetVcs() *Vcs

func (Meta) JSON

func (m Meta) JSON() []byte

func (Meta) MarshalZerologObject

func (m Meta) MarshalZerologObject(e *zerolog.Event)

func (*Meta) ProtoMessage

func (*Meta) ProtoMessage()

func (*Meta) Reset

func (m *Meta) Reset()

func (*Meta) String

func (m *Meta) String() string

func (*Meta) Validate

func (m *Meta) Validate() error

Validate checks the field values on Meta with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

func (*Meta) XXX_DiscardUnknown

func (m *Meta) XXX_DiscardUnknown()

func (*Meta) XXX_Marshal

func (m *Meta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Meta) XXX_Merge

func (m *Meta) XXX_Merge(src proto.Message)

func (*Meta) XXX_Size

func (m *Meta) XXX_Size() int

func (*Meta) XXX_Unmarshal

func (m *Meta) XXX_Unmarshal(b []byte) error

type MetaValidationError

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

MetaValidationError is the validation error returned by Meta.Validate if the designated constraints aren't met.

func (MetaValidationError) Cause

func (e MetaValidationError) Cause() error

Cause function returns cause value.

func (MetaValidationError) Error

func (e MetaValidationError) Error() string

Error satisfies the builtin error interface

func (MetaValidationError) ErrorName

func (e MetaValidationError) ErrorName() string

ErrorName returns error name.

func (MetaValidationError) Field

func (e MetaValidationError) Field() string

Field function returns field value.

func (MetaValidationError) Key

func (e MetaValidationError) Key() bool

Key function returns key value.

func (MetaValidationError) Reason

func (e MetaValidationError) Reason() string

Reason function returns reason value.

type Metaer

type Metaer interface {
	Descriptor() ([]byte, []int)
	Flatten() map[string]interface{}
	GetBuild() time.Time
	GetChannel() string
	GetName() string
	GetRuntime() *Runtime
	GetSemver() string
	GetSerial() string
	GetVcs() *Vcs
	JSON() []byte
	MarshalZerologObject(*zerolog.Event)
	ProtoMessage()
	Reset()
	String() string
	Validate() error
	XXX_DiscardUnknown()
	XXX_Marshal([]byte, bool) ([]byte, error)
	XXX_Merge(protoiface.MessageV1)
	XXX_Size() int
	XXX_Unmarshal([]byte) error
}

Metaer is an interface generated for "github.com/michilu/boilerplate/service/meta.Meta".

type Runtime

type Runtime struct {
	Version              string   `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	Arch                 string   `protobuf:"bytes,2,opt,name=arch,proto3" json:"arch,omitempty"`
	Os                   string   `protobuf:"bytes,3,opt,name=os,proto3" json:"os,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

Runtime is ValueObject of Runtime

func (*Runtime) Descriptor

func (*Runtime) Descriptor() ([]byte, []int)

func (*Runtime) GetArch

func (m *Runtime) GetArch() string

func (*Runtime) GetOs

func (m *Runtime) GetOs() string

func (*Runtime) GetVersion

func (m *Runtime) GetVersion() string

func (*Runtime) ProtoMessage

func (*Runtime) ProtoMessage()

func (*Runtime) Reset

func (m *Runtime) Reset()

func (*Runtime) String

func (m *Runtime) String() string

func (*Runtime) Validate

func (m *Runtime) Validate() error

Validate checks the field values on Runtime with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

func (*Runtime) XXX_DiscardUnknown

func (m *Runtime) XXX_DiscardUnknown()

func (*Runtime) XXX_Marshal

func (m *Runtime) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Runtime) XXX_Merge

func (m *Runtime) XXX_Merge(src proto.Message)

func (*Runtime) XXX_Size

func (m *Runtime) XXX_Size() int

func (*Runtime) XXX_Unmarshal

func (m *Runtime) XXX_Unmarshal(b []byte) error

type RuntimeValidationError

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

RuntimeValidationError is the validation error returned by Runtime.Validate if the designated constraints aren't met.

func (RuntimeValidationError) Cause

func (e RuntimeValidationError) Cause() error

Cause function returns cause value.

func (RuntimeValidationError) Error

func (e RuntimeValidationError) Error() string

Error satisfies the builtin error interface

func (RuntimeValidationError) ErrorName

func (e RuntimeValidationError) ErrorName() string

ErrorName returns error name.

func (RuntimeValidationError) Field

func (e RuntimeValidationError) Field() string

Field function returns field value.

func (RuntimeValidationError) Key

func (e RuntimeValidationError) Key() bool

Key function returns key value.

func (RuntimeValidationError) Reason

func (e RuntimeValidationError) Reason() string

Reason function returns reason value.

type Vcs

type Vcs struct {
	Hash                 string   `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
	Branch               string   `protobuf:"bytes,2,opt,name=branch,proto3" json:"branch,omitempty"`
	Tag                  string   `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-" yaml:"-"`
	XXX_unrecognized     []byte   `json:"-" yaml:"-"`
	XXX_sizecache        int32    `json:"-" yaml:"-"`
}

Vcs is ValueObject of VCS

func (*Vcs) Descriptor

func (*Vcs) Descriptor() ([]byte, []int)

func (*Vcs) GetBranch

func (m *Vcs) GetBranch() string

func (*Vcs) GetHash

func (m *Vcs) GetHash() string

func (*Vcs) GetTag

func (m *Vcs) GetTag() string

func (*Vcs) ProtoMessage

func (*Vcs) ProtoMessage()

func (*Vcs) Reset

func (m *Vcs) Reset()

func (*Vcs) String

func (m *Vcs) String() string

func (*Vcs) Validate

func (m *Vcs) Validate() error

Validate checks the field values on Vcs with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

func (*Vcs) XXX_DiscardUnknown

func (m *Vcs) XXX_DiscardUnknown()

func (*Vcs) XXX_Marshal

func (m *Vcs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Vcs) XXX_Merge

func (m *Vcs) XXX_Merge(src proto.Message)

func (*Vcs) XXX_Size

func (m *Vcs) XXX_Size() int

func (*Vcs) XXX_Unmarshal

func (m *Vcs) XXX_Unmarshal(b []byte) error

type VcsValidationError

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

VcsValidationError is the validation error returned by Vcs.Validate if the designated constraints aren't met.

func (VcsValidationError) Cause

func (e VcsValidationError) Cause() error

Cause function returns cause value.

func (VcsValidationError) Error

func (e VcsValidationError) Error() string

Error satisfies the builtin error interface

func (VcsValidationError) ErrorName

func (e VcsValidationError) ErrorName() string

ErrorName returns error name.

func (VcsValidationError) Field

func (e VcsValidationError) Field() string

Field function returns field value.

func (VcsValidationError) Key

func (e VcsValidationError) Key() bool

Key function returns key value.

func (VcsValidationError) Reason

func (e VcsValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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