Help us shape the future of Go! Take the 2026 Go Developer Survey

noted

package module
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 5 Imported by: 0

README

noted-go

Go SDK for noted library

Using the SDK

To install, run the following command: go get github.com/thenorthnate/noted-go

Example use:

package main

import (
  "fmt"
  "github.com/golang/protobuf/proto"
  noted "github.com/thenorthnate/noted-go"
)

func main() {
  n := noted.New()
  fmt.Printf("%T\n", n)
  fmt.Println(n)
  data, err := proto.Marshal(&n)
  if err != nil {
    fmt.Println("Error occurred: ", err)
    return
  }
  fmt.Printf("%T\n", data)
  fmt.Println(data)
}

Documentation

Index

Constants

View Source
const (
	// Version is the package version
	Version = "0.1.0"
)

Variables

This section is empty.

Functions

func NewId

func NewId() string

NewId is just a wrapper around the google UUID library

func NewTime

func NewTime() string

NewTime generates a time string following RFC3339

func ParseTime

func ParseTime(timestr string) (time.Time, error)

ParseTime is a simple utility to convert the string time to a go time struct It will throw an error if the time string does not comply with RFC3339

Types

type BatchNote

type BatchNote struct {
	Version              string   `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	Time                 string   `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"`
	Notes                []*Note  `protobuf:"bytes,3,rep,name=notes,proto3" json:"notes,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BatchNote) Descriptor

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

func (*BatchNote) GetNotes

func (m *BatchNote) GetNotes() []*Note

func (*BatchNote) GetTime

func (m *BatchNote) GetTime() string

func (*BatchNote) GetVersion

func (m *BatchNote) GetVersion() string

func (*BatchNote) ProtoMessage

func (*BatchNote) ProtoMessage()

func (*BatchNote) Reset

func (m *BatchNote) Reset()

func (*BatchNote) String

func (m *BatchNote) String() string

func (*BatchNote) XXX_DiscardUnknown

func (m *BatchNote) XXX_DiscardUnknown()

func (*BatchNote) XXX_Marshal

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

func (*BatchNote) XXX_Merge

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

func (*BatchNote) XXX_Size

func (m *BatchNote) XXX_Size() int

func (*BatchNote) XXX_Unmarshal

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

type Note

type Note struct {
	Version              string   `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	Time                 string   `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"`
	Type                 string   `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	Source               string   `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"`
	Id                   string   `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
	Credentials          string   `protobuf:"bytes,6,opt,name=credentials,proto3" json:"credentials,omitempty"`
	DataContentType      string   `protobuf:"bytes,7,opt,name=data_content_type,json=dataContentType,proto3" json:"data_content_type,omitempty"`
	Data                 []byte   `protobuf:"bytes,8,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

[START Messages]

func New

func New() Note

New creates a new note with a random ID, the current time, and the default spec version

func (*Note) Descriptor

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

func (*Note) GetCredentials

func (m *Note) GetCredentials() string

func (*Note) GetData

func (m *Note) GetData() []byte

func (*Note) GetDataContentType

func (m *Note) GetDataContentType() string

func (*Note) GetId

func (m *Note) GetId() string

func (*Note) GetSource

func (m *Note) GetSource() string

func (*Note) GetTime

func (m *Note) GetTime() string

func (*Note) GetType

func (m *Note) GetType() string

func (*Note) GetVersion

func (m *Note) GetVersion() string

func (*Note) ProtoMessage

func (*Note) ProtoMessage()

func (*Note) Reset

func (m *Note) Reset()

func (*Note) String

func (m *Note) String() string

func (*Note) XXX_DiscardUnknown

func (m *Note) XXX_DiscardUnknown()

func (*Note) XXX_Marshal

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

func (*Note) XXX_Merge

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

func (*Note) XXX_Size

func (m *Note) XXX_Size() int

func (*Note) XXX_Unmarshal

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

Directories

Path Synopsis
v1
noted module

Jump to

Keyboard shortcuts

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