mobilizon

package
v0.0.0-...-2795187 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	ID     ID
	Type   String // enum
	Name   String
	Local  Bool
	Domain String
}

type Address

type Address struct {
	// ID          ID // FIXME: this breaks AddressInput
	// Geom       Point
	Description String
	OriginId    String
	Street      String
	PostalCode  String
	Locality    String
	Region      String
	Country     String
	Timezone    String
	Type        String
	URL         String
}

type AddressInput

type AddressInput struct {
	Address
}

type Auth

type Auth struct {
	AccessToken  String
	RefreshToken String
}

type Bool

type Bool bool

type DateTime

type DateTime struct {
	time.Time
}

func (DateTime) MarshalJSON

func (t DateTime) MarshalJSON() ([]byte, error)

type Event

type Event struct {
	UUID            UUID
	ID              ID
	Title           String
	Description     String
	PhysicalAddress Address
	BeginsOn        time.Time
	EndsOn          time.Time
	Picture         Media
}

func (Event) AsInput

func (e Event) AsInput() *EventInput

type EventInput

type EventInput struct {
	Event
	Picture         MediaInput
	PhysicalAddress AddressInput
}

type ID

type ID string

type Int

type Int int

type Login

type Login struct {
	Auth
	User User
}

type Media

type Media struct {
	ID          ID
	Name        String
	Alt         String
	URL         String
	ContentType String
	Size        Int
	Metadata    struct {
		Blurhash String
		Height   Int
		Width    Int
	}
}

type MediaInput

type MediaInput struct {
	Media MediaInputObj
}

type MediaInputObj

type MediaInputObj struct {
	File    Upload
	Name    String
	Alt     String
	ActorID ID
}

type Member

type Member struct {
	ID   ID
	Role String // MemberRoleEnum
}

type MobilizonClient

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

func NewMobilizonClient

func NewMobilizonClient(host string) *MobilizonClient

func (*MobilizonClient) Authorize

func (c *MobilizonClient) Authorize(email, pass string) (*User, error)

func (MobilizonClient) CreateEvent

func (c MobilizonClient) CreateEvent(e *EventInput, organizer Actor) (*Event, error)

func (MobilizonClient) CreateEventWithImage

func (c MobilizonClient) CreateEventWithImage(e *EventInput, organizer Actor, picture io.Reader) (*Event, error)

CreateEventWithImage doesn't use the standard graphql client, but does a multipart/form-data request to upload the picture.

func (MobilizonClient) GetEvent

func (c MobilizonClient) GetEvent(uuid UUID) (*Event, error)

func (MobilizonClient) GetEvents

func (c MobilizonClient) GetEvents() ([]*Event, error)

func (MobilizonClient) UploadMedia

func (c MobilizonClient) UploadMedia(fileContent io.Reader, name string) (*Media, error)

type Person

type Person struct {
	Actor
	FeedTokens []struct{ Token String }
	MemberOf   []Member
}

type Point

type Point string

type String

type String string

These are needed so our graphql can unmarshal things :(

type UUID

type UUID string

type Upload

type Upload string

type User

type User struct {
	ID           ID
	Email        ID
	DefaultActor Person
	Role         String // enum
}

Jump to

Keyboard shortcuts

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